Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

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.