i3exit script doesn't work
asked 2013-11-05 06:20:40 +0000
Anonymous
First of all, thank you for i3. I am really enjoying it.
To shutdown/lock/suspend, I have this script:
#!/bin/sh
case "$1" in
lock)
i3lock -c 000000
;;
logout)
i3-msg exit
;;
suspend)
sudo pm-suspend | i3lock -c 000000
;;
hibernate)
sudo pm-hibernate
;;
reboot)
sudo reboot
;;
shutdown)
sudo poweroff
;;
*)
echo "Usage: $0 {lock|logout|suspend|hibernate|reboot|shutdown}"
exit 2
esac
exit 0
Then in my .i3/config
, I added these lines:
set $mode_system System (l) lock, (e) logout, (s) suspend, (h) hibernate, (r) reboot, (Shift+s) shutdown
mode "$mode_system" {
bindsym l exec --no-startup-id i3exit lock, mode "default"
bindsym e exec --no-startup-id i3exit logout, mode "default"
bindsym s exec --no-startup-id i3exit suspend, mode "default"
bindsym h exec --no-startup-id i3exit hibernate, mode "default"
bindsym r exec --no-startup-id i3exit reboot, mode "default"
bindsym Shift+s exec --no-startup-id i3exit shutdown, mode "default"
# back to normal: Enter or Escape
bindsym Return mode "default"
bindsym Escape mode "default"
}
bindsym $mod+End mode "$mode_system"
Here is the issue: if I just call i3exit lock
, it will lock the screen. If I press the combination above to call $mode
, I am shown the menu but when I choose any of the options (lock, suspend), nothing happens. The menu goes away but nothing else happens.
i3exit
is executable and in $PATH
. How do I debug this issue? Also note that it was working fine before but wierdly it stopped working. I don't recall having done anything special.
Tried diagnosing it. The error that is thrown up is: `/bin/bash: i3exit: command not found`. But on running `i3exit` from anywhere, it is found.