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 put a button on the desktop to shutdown pc? I use Ubuntu 13.04 with unity. Thank you for a help

share|improve this question
    
Why not just hit the power button? –  Alvar Jun 22 '13 at 16:13
    
Or select shutdown from the top right gear icon? –  amc Jun 22 '13 at 20:01
    
You can also use the HUD by writing "Shutdown"'s translation into it and then select the option to do this. –  air-dex Jun 22 '13 at 22:03

1 Answer 1

  1. Ctrl+Alt+T - Opens the terminal
  2. touch ~/Desktop/Shutdown.sh && chmod 755 ~/Desktop/Shutdown.sh - Creates Shutdown.sh and sets execute permission
  3. gedit ~/Desktop/Shutdown.sh - Opens the file in gedit.
  4. Copy and Paste the following line in gedit

    pkexec shutdown -P -h now
    
  5. Save the file and close gedit.

  6. As per this Answer, make sure that you can execute executable files.
  7. Now double click on Shutdown.sh file in the desktop. It would show something like this and enter the password.

enter image description here

It should shutdown your machine now.

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.