diff options
author | Justine Smithies <justine@smithies.me.uk> | 2023-10-11 18:21:52 +0100 |
---|---|---|
committer | Justine Smithies <justine@smithies.me.uk> | 2023-10-11 18:21:52 +0100 |
commit | 786f9c22fab19de866566de4c7933aef416a1462 (patch) | |
tree | 512c3563b43a511171979604d6a2a09a4b68c50a /.config/yambar/scripts/void-updates.sh | |
parent | ba6e0a870faa3306b1e15bd03460b2faa30ceb37 (diff) |
Switched to River
Diffstat (limited to '.config/yambar/scripts/void-updates.sh')
-rwxr-xr-x | .config/yambar/scripts/void-updates.sh | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/.config/yambar/scripts/void-updates.sh b/.config/yambar/scripts/void-updates.sh new file mode 100755 index 0000000..98b3e0b --- /dev/null +++ b/.config/yambar/scripts/void-updates.sh @@ -0,0 +1,38 @@ +#!/bin/bash + +function update-yambar { +echo "updates|string|" +echo "" + +while true; do + +xbps-install -Mun 1> /tmp/void-updates +updates="$(cat /tmp/void-updates | awk '{ print $1 }')" +number="$(cat /tmp/void-updates | wc -l)" + +if [ "$number" -gt 0 ]; then + text=" $number" +else + text="" +fi + +echo "updates|string|$text" +echo "" +sleep 30m + +done +} + +function update { + foot bash -c "sudo xbps-install -Suv"; sh -c "~/.config/yambar/scripts/yambar-start.sh" +} + +case $1 in + update) + update + ;; + *) + update-yambar + ;; +esac +exit 0 |