summaryrefslogtreecommitdiffstats
path: root/clerk_updater
diff options
context:
space:
mode:
authorRasmus Steinke <rasi@xssn.at>2015-03-06 03:07:29 +0100
committerRasmus Steinke <rasi@xssn.at>2015-03-06 03:07:29 +0100
commitf8bb77c8200a8a1dc300d484333aa9e9c23999e5 (patch)
tree736f74e8f713b81cc54c81cc3f40a4faa8717066 /clerk_updater
parent3a50476ce000d4d1a76adc14ad2b59b8d39c0b1a (diff)
downloadperl-app-clerk-f8bb77c8200a8a1dc300d484333aa9e9c23999e5.tar.gz
perl-app-clerk-f8bb77c8200a8a1dc300d484333aa9e9c23999e5.tar.xz
combine clerk_updater and clerk_helper
Diffstat (limited to 'clerk_updater')
-rwxr-xr-xclerk_updater54
1 files changed, 0 insertions, 54 deletions
diff --git a/clerk_updater b/clerk_updater
deleted file mode 100755
index 99a75e6..0000000
--- a/clerk_updater
+++ /dev/null
@@ -1,54 +0,0 @@
-#!/bin/bash
-
-# create cached album list
-source $HOME/.config/clerk/config
-
-# Use GNU coreutils on OSX
-sed=$([[ "$OSTYPE" == "darwin"* ]] && echo 'gsed' || echo 'sed')
-
-notify()
-{
- if hash notify-send 2>/dev/null; then
- notify-send "clerk" "Creating caches"
- elif hash say 2>/dev/null; then
- say "Updating clerk caches"
- fi
-}
-
-
-update() {
- new_db="$(mpc stats | grep Updated | $sed 's/ //g')"
- if [[ "$change_db" == "$new_db" ]]; then
- if [[ -f $HOME/.config/clerk/album.cache && -f $HOME/.config/clerk/tracks.cache && -f $HOME/.config/clerk/last.cache ]]; then
- :
- else
- notify
- export separator="$separator"; clerk_helper albumcache
- export separator="$separator"; clerk_helper trackcache
- export separator="$separator"; clerk_helper lastcache
- fi
- else
- notify
- $sed -i "s/change_db=".*"/change_db=""$new_db""/" $HOME/.config/clerk/config
- export separator="$separator"; clerk_helper albumcache
- export separator="$separator"; clerk_helper trackcache
- export separator="$separator"; clerk_helper lastcache
- fi
-}
-
-force() {
- notify
- new_db="$(mpc stats | grep Updated | $sed 's/ //g')"
- $sed -i "s/change_db=".*"/change_db=""$new_db""/" $HOME/.config/clerk/config
- export separator="$separator"; clerk_helper albumcache
- export separator="$separator"; clerk_helper trackcache
- export separator="$separator"; clerk_helper lastcache
-}
-
-if [[ $1 == "--force" ]]; then
- force
-else
- update
-fi
-
-