Browse Source

add zenity for dialog boxes and add shutdown handler that works with a zenity dialog

bananicorn 3 years ago
parent
commit
9b9a1f76b1

+ 2 - 1
devuan_setup/config/sway/config

@@ -31,7 +31,7 @@ floating_modifier $Mod
 
 # kill focused window
 bindsym $Mod+Shift+q kill
-bindsym Mod1+F4 kill, exec "swaynag -t warning -m 'Shut down?' -B 'Shut down' 'sudo poweroff' -B 'Reboot' 'sudo reboot'"
+bindsym Mod1+F4 kill, exec "~/scripts/shutdown_handler.sh"
 
 # change focus
 bindsym $Mod+$left focus left
@@ -172,3 +172,4 @@ default_border		pixel
 
 for_window [app_id="connman-gtk"] floating enable
 for_window [app_id="love-11.3"] floating enable
+for_window [app_id="zenity"] floating enable

+ 6 - 0
devuan_setup/scripts/shutdown_handler.sh

@@ -0,0 +1,6 @@
+#!/bin/bash
+if zenity --question --text 'Shutdown?' --ok-label 'Shutdown' --cancel-label 'Cancel'; then
+	exec sudo poweroff
+fi
+
+

+ 3 - 0
devuan_setup/setup_system.sh

@@ -14,6 +14,9 @@ rm -rf ~/.profile
 ln -s ~/dotfiles/devuan_setup/.profile ~/.profile
 ln -s ~/dotfiles/devuan_setup/config/user-dirs.dirs ~/.config/
 
+#dialog boxes
+apt install -y zenity
+
 #image viewer
 apt install -y imv