The i3 FAQ has migrated to https://github.com/i3/i3/discussions. All content here is read-only.
Ask Your Question
1

i3exit script doesn't work

asked 2013-11-05 06:20:40 +0000

anonymous user

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.

edit retag flag offensive close merge delete

Comments

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.

mneywn gravatar imagemneywn ( 2013-11-05 06:41:58 +0000 )edit

1 answer

Sort by ยป oldest newest most voted
2

answered 2013-11-05 06:51:27 +0000

Flugsio gravatar image

updated 2013-11-05 06:52:30 +0000

I suspect your path is not set for i3. Easy solution is to change i3exit with its full path.

Setting path depends on how you start i3, debug with this:

bindsym $mod+Shift+i exec --no-startup-id echo $PATH >> .i3_debug

This post have a solution for lightdm and a fancier way to debug the path, https://faq.i3wm.org/question/2483/ho...

edit flag offensive delete link more

Comments

Thanks, giving the full path worked.

mneywn gravatar imagemneywn ( 2013-11-05 13:04:33 +0000 )edit

Question Tools

1 follower

Stats

Asked: 2013-11-05 06:20:40 +0000

Seen: 1,643 times

Last updated: Nov 05 '13