3

how can I put a button on the desktop to shutdown pc? I use Ubuntu 13.04 with unity. Thank you for a help

3
  • Why not just hit the power button?
    – Alvar
    Jun 22, 2013 at 16:13
  • Or select shutdown from the top right gear icon?
    – amc
    Jun 22, 2013 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, 2013 at 22:03

1 Answer 1

5
  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.

1
  • Isn't there a way to do this without having to authenticate every time you want to switch off the device?
    – Prajwal
    Apr 25, 2021 at 11:16

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .