aboutsummaryrefslogtreecommitdiff
path: root/.config/yambar/scripts/chimera-updates.sh
diff options
context:
space:
mode:
authorJustine Smithies <justine@smithies.me.uk>2024-06-02 13:18:49 +0100
committerJustine Smithies <justine@smithies.me.uk>2024-06-02 13:18:49 +0100
commit1695d600a000abf65ef6e5e0a176991c00773b31 (patch)
treef59fa43c3a359e748da9ca85fffe9417bdbb3676 /.config/yambar/scripts/chimera-updates.sh
parentcb2aa2a9ab0bff2c4c17323f592aae9964f62495 (diff)
Added Chimera Linux updates script ( Allowed wheel group to 'apk update' only in doas.conf )
Diffstat (limited to '.config/yambar/scripts/chimera-updates.sh')
-rwxr-xr-x.config/yambar/scripts/chimera-updates.sh38
1 files changed, 38 insertions, 0 deletions
diff --git a/.config/yambar/scripts/chimera-updates.sh b/.config/yambar/scripts/chimera-updates.sh
new file mode 100755
index 0000000..2a948ae
--- /dev/null
+++ b/.config/yambar/scripts/chimera-updates.sh
@@ -0,0 +1,38 @@
+#!/bin/bash
+
+function update-yambar {
+echo "updates|string|"
+echo ""
+
+while true; do
+
+doas apk update
+updates="$(apk -u list | awk '{ print $1 }')"
+number="$(apk -u list | wc -l | awk '{$1=$1};1')"
+
+if [ "$number" -gt 0 ]; then
+ text=" $number"
+else
+ text=""
+fi
+
+echo "updates|string|$text"
+echo ""
+sleep 30m
+
+done
+}
+
+function update {
+ foot bash -c "doas apk upgrade"; sh -c "~/.config/yambar/scripts/yambar-start.sh"
+}
+
+case $1 in
+ update)
+ update
+ ;;
+ *)
+ update-yambar
+ ;;
+esac
+exit 0