The i3 FAQ has migrated to All content here is read-only.
Ask Your Question

Unable to hibernate with bindsym

asked 2015-02-19 14:50:53 +0000

apoc gravatar image

I have tried various approaches to allow my user hibernate my system using the modifier key + Escape.

Initially I performed this by executing sudo hibernate | i3lock in the terminal. Where I always had to enter my password.

Then I allowed my user to execute sudo hibernate without password - this works in the terminal. This made i3lock; sudo hibernate possible and I thought it would work to exec i3lock; sudo hibernate on the bindsym, but I an i3 error, stating that there's something wrong at sudo.

My idea was to allow the user to execute hibernate without sudo, so I created a symbolic link from /usr/sbin/hibernate to /usr/bin/hibernate and added the suid bit on /usr/sbin/hibernate, which doesn't seem to work. My user is not able to run it without using sudo.


How can I bindsym i3lock and hibernate to my modifier + Escape (Debian Jessie)

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2015-02-20 01:19:11 +0000

Adaephon gravatar image

; is a syntactic element of the i3 configuration. Just like in the shell it is used to separate commands in this case exec i3lock and sudo hibernate. Of course, there is no sudo command in i3, hence the error.

Try quoting the shell command (everything after exec) with double quotes:

bindsym $mod+Escape exec "i3lock; sudo hibernate"
edit flag offensive delete link more


To my surprise this works perfectly nice! I thought I tried this syntax already, but as it seems I didn't. Before changing it to your suggestion, I used `bindsym $mod+Escape exec bash -c "i3lock; sudo hibernate"` which didn't work - yet I don't understand why.. thanks a lot for the assistance!

apoc gravatar imageapoc ( 2015-02-20 09:08:15 +0000 )edit

Question Tools


Asked: 2015-02-19 14:50:53 +0000

Seen: 285 times

Last updated: Feb 20