Shutting Ubuntu down with Lirc?

Soldato
Joined
7 Jan 2007
Posts
10,607
Location
Sussex, UK
Yo,

Updated my Daddies Ubuntu Boxee box :p

The Microsoft Mce Remote was easy to setup but what I would like the remote to do is shutdown the compter by pressing a button on the remote.

Anyone know how to do this?

I know the code of the button press, I got this from irw.
 
Hi,

Never used it, but found this http://www.mythtv.org/wiki/Customized_Remote_Control_Keys for custom buttons in the lirc config. It's for myth but hopefully the lirc/mce stuff is still relevant?

Maybe you could do something like this:

Code:
begin
    prog = irexec
    button = Power
    repeat = 3
    config = /usr/local/bin/powerctl.sh
end

and /usr/local/bin/powerctl.sh (made executable chmod+x):

Code:
#!/bin/sh
sudo shutdown -h now

Probably will want to modify sudo so it doesn't password prompt for shutdown use.
 
Got all the remote working with the shutdown irexec file, but can't seem to get irexec to auto start in the GUI.

Would you know where to find an innit script?

My linux knowledge still isn't good enough to create my own :(


The box runs Ubuntu 10.10 32bit
 
Got all the remote working with the shutdown irexec file, but can't seem to get irexec to auto start in the GUI.

Would you know where to find an innit script?

My linux knowledge still isn't good enough to create my own :(


The box runs Ubuntu 10.10 32bit

Haven't got much experience with Ubuntu init scripts either :( there's some good stuff in this thread though: http://ubuntuforums.org/showthread.php?t=371484 hopefully that will point you in the right direction :)
 
Back
Top Bottom