how can I put a button on the desktop to shutdown pc?
5,410
-
Ctrl+Alt+T - Opens the terminal
-
touch ~/Desktop/Shutdown.sh && chmod 755 ~/Desktop/Shutdown.sh
- Creates Shutdown.sh and sets execute permission -
gedit ~/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.
Related videos on Youtube
Author by
Admin
Updated on September 18, 2022Comments
-
Admin about 1 year
how can I put a button on the desktop to shutdown pc? I use Ubuntu 13.04 with unity. Thank you for a help
-
amc over 10 yearsOr select shutdown from the top right gear icon?
-
air-dex over 10 yearsYou can also use the HUD by writing "Shutdown"'s translation into it and then select the option to do this.
-
-
Prajwal Dhatwalia over 2 yearsIsn't there a way to do this without having to authenticate every time you want to switch off the device?