diff options
Diffstat (limited to 'dot-config/yambar/scripts')
| -rwxr-xr-x | dot-config/yambar/scripts/pacman-label | 7 | ||||
| -rwxr-xr-x | dot-config/yambar/scripts/pacman-notify | 18 |
2 files changed, 25 insertions, 0 deletions
diff --git a/dot-config/yambar/scripts/pacman-label b/dot-config/yambar/scripts/pacman-label new file mode 100755 index 0000000..7015e5b --- /dev/null +++ b/dot-config/yambar/scripts/pacman-label @@ -0,0 +1,7 @@ +#!/bin/sh + +# Get package count +count=$(wc -l < ~/.cache/updates) + +# Display count +printf "%s\n\n" "count|int|$count" diff --git a/dot-config/yambar/scripts/pacman-notify b/dot-config/yambar/scripts/pacman-notify new file mode 100755 index 0000000..a9ce535 --- /dev/null +++ b/dot-config/yambar/scripts/pacman-notify @@ -0,0 +1,18 @@ +#!/bin/sh + +# Get package count +count=$(wc -l < ~/.cache/updates) + +# Generate message +if [ "$count" = 0 ]; then + msg="No updates available" +else + msg="$count Available Update" + (("$count" > 1 )) && msg+="s" +fi + +# Notify +notify-send \ + -i package-x-generic \ + -h string:x-canonical-private-synchronous:updates \ + "$msg" "$(cut -f1 -d' ' ~/.cache/updates)" |
