From a22f9f6bbf969516226efa3ed595d5330e2da0c1 Mon Sep 17 00:00:00 2001 From: littleblack111 Date: Tue, 24 Feb 2026 17:00:41 +0800 Subject: new: hyprshutdown --- hyprshutdown.sh | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100755 hyprshutdown.sh 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 -- cgit v1.2.3