4

How can I shutdown the computer with the IR controller ? It has many working buttons, which can be used correctly, but the power button doesn't do anything. Is there a way to program a script to a button ? Remote controller works with LIRC under XMBC on Ubuntu 10.04.

1 Answer 1

2

As the root user, you could define something like this in the ~/.lircrc file (with "POWER" replaced with whatever is correct for your remote):

begin
 prog = rawcontrol
 button = POWER
 config = power
end

Then add something like this to /etc/rc.local or another init script:

ircat rawcontrol | (while read line
do
        if [ "x$line" = "xpower" ]; then
                shutdown -h now
        fi
done) &

This will have "ircat" watch for events using the "rawcontrol" definitions. When it sees "power" get pressed, it'll shut down the system.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .