Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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):

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.

share|improve this answer

Your Answer

 
discard

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.