From 5da5ac0e5bdd0d17b791829e1283a9a1b3880a9d Mon Sep 17 00:00:00 2001 From: Thomas Dehaeze Date: Tue, 3 Nov 2020 11:39:23 +0100 Subject: [PATCH] Add confirmation for reboot/shutdown --- dotfiles/binaries.org | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/dotfiles/binaries.org b/dotfiles/binaries.org index 2926cca..b7adffc 100644 --- a/dotfiles/binaries.org +++ b/dotfiles/binaries.org @@ -580,10 +580,20 @@ Script taken from Luke Smith. systemctl hibernate && ~/.local/bin/lockscreen ;; "Reboot") - systemctl reboot + confirmation=$(echo -e "Yes\nNo" | rofi -i -p "Are you sure you want to Reboot?" -dmenu) + case "$confirmation" in + "Yes") + systemctl reboot + ;; + esac ;; "Shutdown") - systemctl poweroff + confirmation=$(echo -e "Yes\nNo" | rofi -i -p "Are you sure you want to Shutdown?" -dmenu) + case "$confirmation" in + "Yes") + systemctl poweroff + ;; + esac ;; ,*) echo "== ! i3exit: missing or invalid argument ! =="