commit 037e738e5956ee975fb9ab91ce33212e5a580c0d parent 16b1850ab6aefdc832f162957ffbf6111eb4aa0d Author: Chris Bracken <chris@bracken.jp> Date: Fri, 16 Nov 2018 09:58:41 -0800 Use dmenu to check if user wants to exit i3-nagbar requires the mouse. dmenu is more convenient. Diffstat:
M | .i3/config | | | 2 | +- |
A | .i3/exit_check.sh | | | 10 | ++++++++++ |
2 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/.i3/config b/.i3/config @@ -113,7 +113,7 @@ bindsym $mod+Shift+c reload # restart i3 inplace (preserves your layout/session, can be used to upgrade i3) bindsym $mod+Shift+r restart # exit i3 (logs you out of your X session) -bindsym $mod+Shift+e exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -b 'Yes, exit i3' 'i3-msg exit'" +bindsym $mod+Shift+e exec ~/.i3/exit_check.sh # resize window (you can also use the mouse for that) mode "resize" { diff --git a/.i3/exit_check.sh b/.i3/exit_check.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +# Use dmenu to check if the user wants to exit i3. + +while [ "$choice" != "no" -a "$choice" != "yes" ]; do + choice=$(echo -e 'no\nyes' | dmenu -p "Really exit?") +done +if [ "$choice" == "yes" ]; then + i3-msg exit +fi