Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 2503

Raspberry Pi OS • Re: Autostart with labwc

$
0
0

Is there a way in labwc to rewire the powerkey to a script?
This is what I had in wayfire.ini:

Code:

#command_power = pwrkeycommand_power=/home/pi/luca/shutdown_hdd.sh;sudo shutdown -P now
Just found a way! It wasn't documented anywhere but I looked at the rc.all.xml file and there were some special keys for volume control and so on, so I looked where these "XF86"-prefixed things were coming from, and what do you know? There was one for the power button!

In ~/.config/labwc/rc.xml add something similar to this "keybind" tag inside the probably already existing "keyboard" tag:

Code:

...<keyboard>    <keybind key="XF86PowerOff">      <action name="Execute" command="shutdown -P now" />    </keybind></keyboard>...
It doesn't seem to work with multiple commands joined by ; or &&, but you can put everything in a script file and run that instead.

Statistics: Posted by 2bam — Tue Feb 04, 2025 6:43 pm



Viewing all articles
Browse latest Browse all 2503

Trending Articles