diff options
author | Rasmus Steinke <rasi@xssn.at> | 2016-01-20 21:40:29 +0100 |
---|---|---|
committer | Rasmus Steinke <rasi@xssn.at> | 2016-01-20 21:40:29 +0100 |
commit | 628e735917c8362b8ed36d8df7cfcb297361bc7e (patch) | |
tree | 9d28349944d054e14f1d2e73329ee3a4fdf4ede8 /clerk | |
parent | 79a7dc91f8c905b49c39994314dbd411b3203bc5 (diff) | |
download | perl-app-clerk-628e735917c8362b8ed36d8df7cfcb297361bc7e.tar.gz perl-app-clerk-628e735917c8362b8ed36d8df7cfcb297361bc7e.tar.xz |
dont run update twice
Diffstat (limited to 'clerk')
-rwxr-xr-x | clerk | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -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 |