Score:0

How to create a "shutdown" unity launcher in Ubuntu 20.04

us flag
Ian

How can I shutdown my laptop in one mouse click (or maybe two mouse clicks) from the unity launcher?

I've found a number of posts which describe how to create a unity launcher so you can shutdown your laptop with one mouse click - but these are for older versions of Unbuntu (16.04 etc). https://www.faqforge.com/linux/distributions/ubuntu/trigger-system-shutdown-ubuntu-unity-launcher/

Unfortunately these methods don't appear to work with the current version of Unity. Any help would be much appreciated.

kanehekili avatar
zw flag
Are we talking about "gnome"? Ubuntu 20.04 doesn't use "unity" anymore. And why don't you want to use the "power" icon on the top right?
vanadium avatar
cn flag
Does this answer your question? [What is the shutdown command?](https://askubuntu.com/questions/283984/what-is-the-shutdown-command)
Art Swri avatar
sd flag
This (and answer from kanehekili) is EXTREMELY valuable for some circumstances. (It's helpful for 'regular' people who want / need to use a Gnome desktop in the easiest way possible.) See my comment at his answer.
Score:0
zw flag

In case you are using a standard Ubuntu with "gnome" (not unity - which would make not much difference) here my proposal: create a file like /home/yourusername/.local/share/applications/exit.desktop

Add the following code:

#!/usr/bin/env xdg-open
[Desktop Entry]
Encoding=UTF-8
Version=1.0
Type=Application
Exec=systemctl poweroff
Name=My Exit
Comment=One Click Exit 
Icon=application-exit
NoDisplay=false
Categories=Utilities;System

Save it. I had to change the "group" to "adm", by using the properties dialog:

Go to activities and search for "exit". Rightclick the icon and add it as "favorite". Now you have your icon (choose any you like) in the "dock"...

us flag
Ian
Thank you. This works brilliantly and is exactly what I was trying to do.
kanehekili avatar
zw flag
Then you should accept the answer. It honors the time one put into it ;-)
us flag
Ian
:-) Accepted the answer - Thanks.......BTW it's not that obvious to a new user that you are supposed to do this??
kanehekili avatar
zw flag
No sir. There might be tools around (I haven't checked) but it took me some time in the past to figure it out Glad I could share and it helped you. Especially Gnome incapacitates the user - one of the reasons why I'd prefer either KDE or XFCE. But it is a good place to start, as long as Gnome will provide a terminal ;-)
Art Swri avatar
sd flag
For me I had a system that was having graphics problems. Monitors going blank - so the top panel could not be seen or accessed. So (a) use gnome-extension to put the launcher (at least for now) on all monitors (ran gnome-extensions prefs [email protected]) and (b) create the button per kanehekili answer and add to the dash/launcher. Now I have a quick shutdown button on all screens/monitors - much better than yanking power every time the graphics go wonky. Thanks kanehekili!!!
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.