Sign up ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

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.

share|improve this question

1 Answer 1

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

 prog = rawcontrol
 button = POWER
 config = power

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

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

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

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.