how can I put a button on the desktop to shutdown pc? I use Ubuntu 13.04 with unity. Thank you for a help
-
Why not just hit the power button?– AlvarJun 22, 2013 at 16:13
-
Or select shutdown from the top right gear icon?– amcJun 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-dexJun 22, 2013 at 22:03
1 Answer
Ctrl+Alt+T - Opens the terminal
touch ~/Desktop/Shutdown.sh && chmod 755 ~/Desktop/Shutdown.sh
- Creates Shutdown.sh and sets execute permissiongedit ~/Desktop/Shutdown.sh
- Opens the file in gedit.Copy and Paste the following line in gedit
pkexec shutdown -P -h now
Save the file and close gedit.
As per this Answer, make sure that you can execute executable files.
Now double click on
Shutdown.sh
file in the desktop. It would show something like this and enter the password.
It should shutdown your machine now.
-
Isn't there a way to do this without having to authenticate every time you want to switch off the device?– PrajwalApr 25, 2021 at 11:16