Results 1 to 6 of 6

Thread: [SOLVED] Powering off computer with remote power button

  1. #1
    Join Date
    Feb 2007
    Beans
    29

    [SOLVED] Powering off computer with remote power button

    Is this possible?

    Using the power button to execute a script to turn off the box? I know turning it on would be an exercise in futility but being able to fire off a bash script to properly shutdown the system would be very cool indeed

    This is for the grey style pvr350 remote

    http://www.mythtv.org/wiki/index.php...te_Quick_Guide

  2. #2
    Join Date
    Feb 2007
    Beans
    29

    Re: PVR350 remote question

    What I am assuming is I need to startup irexec in daemon mode, add the ability to have my mythtv account run shutdown elevated from editing sudouser (or users I forget which) then add code in .lircrc to have irexec run shutdown

    would something like that work?

  3. #3
    Join Date
    Oct 2005
    Location
    Austin, TX
    Beans
    2,983
    Distro
    Ubuntu Development Release

    Re: PVR350 remote question

    Oh yeah. This is definitely possible. I will warn though, it becomes very easy to "accidentally" turn off the box when you don't want to.

    This is the easiest way (I think):

    First set the /sbin/shutdown SUID (this lets you issue a shutdown without needing to use sudo)
    See this post for info on how to do this:
    http://ubuntuforums.org/showpost.php...59&postcount=3


    Next, you need to add an additional command to your ~/.lircrc

    Code:
    begin
         prog = irexec
         button = power
         config = shutdown -h now
    end
    That button may be a little different, check your /etc/lirc/lircd.conf to verify that is what your power button is called.

    Log out and back in. Irexec is automatically started when you log in.

    Press your button and go.

  4. #4
    Join Date
    Feb 2007
    Beans
    29

    Re: PVR350 remote question

    Perfect! Worked like a charm!

    I have to say your myth ubuntu project here has turned what I thought was going to be a several weekend hack job into a casual Sunday night setup.

    thank you for making my weekend

    Mythbuntu at least for me worked flawlessly once I tweaked the few settings that needed tweaking for my system. I can now watch tv from my computer room.

  5. #5
    Join Date
    Aug 2006
    Beans
    Hidden!

    Re: [SOLVED] Powering off computer with remote power button

    Very useful! I used ubuntu earlier and there I alwasy got the shutdown dialog when pressing the Power button. But now when I am running Mythbuntu I was missing that ...

    No this is not a problem anymore.

    Thanks!!

  6. #6
    Join Date
    May 2007
    Beans
    12

    Re: [SOLVED] Powering off computer with remote power button

    For the really lazy, if you want a way to turn you TV back on using a remote...

    http://www.simerec.com/

    I love it!

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •