Results 1 to 3 of 3

Thread: Use PC's power button while screen is locked

  1. #1
    Join Date
    Jan 2011
    Beans
    1

    Use PC's power button while screen is locked

    I am building a small Ubuntu box made for our clients to listen to an audio stream. At startup, I have scripts that start the audio stream, then locks the screen so clients can't change any settings. It works flawlessly.

    However, if a client has to shut down the box, they can't. Note this is a headless unit, no monitor, keyboard, or mouse. It will ONLY be used to play streaming audio. I need for the client to be able to safely shutdown the unit by pressing the power button. But, when the power button is pressed, ubuntu asks for the user password. Is there a way to just make the system shutdown without entering a password?

    Thanks everyone!

  2. #2

    Re: Use PC's power button while screen is locked

    Hi,

    As root, open the file /etc/acpi/powerbtn.sh

    (If anyone reading doesn't know how to do this, you can press Alt+F2 and paste the following command in:

    gksudo gedit /etc/acpi/powerbtn.sh)

    Now find the line that says:

    Code:
    if pidof x $PMS > /dev/null ||
    and add this directly above that line:

    Code:
    /sbin/shutdown -h now "Power button pressed"
    now save and exit, press Ctrl+Alt+L to lock your screen - et voila, your machine should unceremoniously shut down when you press the power button.
    Last edited by arbitrarychoiceofmoniker; May 3rd, 2011 at 08:21 PM.

  3. #3
    Join Date
    Sep 2012
    Beans
    7

    Re: Use PC's power button while screen is locked

    Sorry, wrong thread.

Tags for this Thread

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
  •