diff options
| author | littleblack111 <littleblack11111@gmail.com> | 2026-02-24 17:00:41 +0800 |
|---|---|---|
| committer | littleblack111 <littleblack11111@gmail.com> | 2026-02-24 17:00:41 +0800 |
| commit | a22f9f6bbf969516226efa3ed595d5330e2da0c1 (patch) | |
| tree | 7cacf32218b73db51714c9a8f360ff479b89b7c0 /hyprshutdown.sh | |
| parent | 5a1ec0958c698baceda6459f2f455d38b681d731 (diff) | |
new: hyprshutdown
Diffstat (limited to 'hyprshutdown.sh')
| -rwxr-xr-x | hyprshutdown.sh | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/hyprshutdown.sh b/hyprshutdown.sh new file mode 100755 index 0000000..9e78c91 --- /dev/null +++ b/hyprshutdown.sh @@ -0,0 +1,21 @@ +#!/usr/bin/env sh + +WAIT=10 # in seconds +self=$$ +cancel="Cancel" +confirm="Confirm" + +function dialog { + ans=$(timeout 1.2 hyprland-dialog --apptitle hyprshutdown --title "Shutting down in $1" --buttons "$cancel;$confirm") + if [[ $ans == $confirm ]]; then + hyprshutdown + kill $self + elif [[ $ans == $cancel ]]; then + kill $self + fi +} + +for ((i=WAIT; i>=0; i--)); do + dialog $i & + sleep 1 +done |
