summaryrefslogtreecommitdiff
path: root/polybar/scripts/updates-action.sh
diff options
context:
space:
mode:
Diffstat (limited to 'polybar/scripts/updates-action.sh')
-rwxr-xr-xpolybar/scripts/updates-action.sh16
1 files changed, 16 insertions, 0 deletions
diff --git a/polybar/scripts/updates-action.sh b/polybar/scripts/updates-action.sh
new file mode 100755
index 0000000..a22a747
--- /dev/null
+++ b/polybar/scripts/updates-action.sh
@@ -0,0 +1,16 @@
+#!/usr/bin/env bash
+set -euo pipefail
+
+cmd='sudo pacman -Syu; echo; read -r -p "Press Enter to close..."'
+
+if command -v kitty >/dev/null 2>&1; then
+ exec kitty --title "System update" /usr/bin/env bash -lc "$cmd"
+elif command -v foot >/dev/null 2>&1; then
+ exec foot --title "System update" /usr/bin/env bash -lc "$cmd"
+elif command -v xterm >/dev/null 2>&1; then
+ exec xterm -T "System update" -e /usr/bin/env bash -lc "$cmd"
+fi
+
+if command -v dunstify >/dev/null 2>&1; then
+ dunstify -a polybar -u normal "Updates" "No terminal found"
+fi