Results 1 to 3 of 3

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

  1. #1
    Join Date
    Jan 2011

    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


    As root, open the file /etc/acpi/

    (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/

    Now find the line that says:

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

    /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

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

    Sorry, wrong thread.

Tags for this Thread


Posting Permissions

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