summaryrefslogtreecommitdiffstats
path: root/clerk
diff options
context:
space:
mode:
authorRasmus Steinke <rasi@xssn.at>2016-01-20 21:40:29 +0100
committerRasmus Steinke <rasi@xssn.at>2016-01-20 21:40:29 +0100
commit628e735917c8362b8ed36d8df7cfcb297361bc7e (patch)
tree9d28349944d054e14f1d2e73329ee3a4fdf4ede8 /clerk
parent79a7dc91f8c905b49c39994314dbd411b3203bc5 (diff)
downloadperl-app-clerk-628e735917c8362b8ed36d8df7cfcb297361bc7e.tar.gz
perl-app-clerk-628e735917c8362b8ed36d8df7cfcb297361bc7e.tar.xz
dont run update twice
Diffstat (limited to 'clerk')
-rwxr-xr-xclerk8
1 files changed, 6 insertions, 2 deletions
diff --git a/clerk b/clerk
index 6017489..cc199f3 100755
--- a/clerk
+++ b/clerk
@@ -120,8 +120,8 @@ fi
# set help color
if [[ $help_color == "" ]]; then
- help_color=$(dmenu_t -dump-xresources | grep -P '^rofi.color.normal' | awk -F ',' '{ print $2 }')
- help_separator_color=$(dmenu_t -dump-xresources | grep -P 'rofi.color.normal' | awk -F ',' '{ print $2 }')
+ help_color=$(dmenu_t -dump-xresources | grep -P '^rofi.color.normal' | awk -F ',' '{ print $2 }' | xargs)
+ help_separator_color=$(dmenu_t -dump-xresources | grep -P 'rofi.color.normal' | awk -F ',' '{ print $2 }' | xargs)
fi
fix_date_format() {
@@ -196,6 +196,9 @@ updateCache () {
# | gawk -F '\t' '{ printf "%.2s\t%.40s\t%.40s\t%.200s\t%.500s\n", $1, $2, $3, $4, $5, $6 }' \
}
+if [[ $1 == "--update" ]]; then
+ :
+else
date=$(mpc stats | grep 'DB Updated: ')
file="$HOME/.config/clerk/.lastupdate"
if [ "$(< $file)" = "$date" ] && [ -f "$file" ] ; then
@@ -203,6 +206,7 @@ updateCache () {
else
updateCache
echo "${date}" > "${file}"
+ fi
fi
# Use GNU coreutils on OSX