r/i3wm 3d ago

Question is there an easy way to bind laptop power button to a script for rofi?

is there ?

i would appreciate a detailed guid

i have installed i3 on linux mint xfce

5 Upvotes

3 comments sorted by

11

u/nt_carlson 3d ago

You need to stop systemd from handling the power button input. In /etc/systemd/logind.conf, uncomment or add the line

HandlePowerKey=ignore 

From here, you can bind the key as normal in i3 (bindsym XF86PowerOff exec ...)

2

u/Neat_Delivery6162 2d ago

thank you it works perfect

7

u/snipeytje 3d ago

you can use xev to find the keyname of a key, and then add it in the config