Shutdown Applet

by shelley

UUID: ShutdownApplet@shelley
Score: 34
Last edited: 6 days ago
Last commit: 491816b271d00160f783027a80747468da09f4e2



An applet to help you shutdown, restart and suspend your system with single click

48 Comments

-
9 months ago
@Grigorij: I had the same problem. You can change the commands in the file "applet.js", e. g.:<br>
<br>
vi ${HOME}/.local/share/cinnamon/applets/ShutdownApplet@shelley/applet.js<br>
(or gedit / xed instead of vi).<br>
<br>
* Screen Lock: The lock-Method needs now a string parameter. Append "string:" to the command, the new line looks like:<br>
Util.spawnCommandLine("dbus-send --session --type=method_call --print-reply --dest=org.gnome.ScreenSaver /org/gnome/ScreenSaver org.gnome.ScreenSaver.Lock string:");<br>
<br>
If you use Linuxmint 18 Cinnamon, you have to change the command as following:<br>
Util.spawnCommandLine("dbus-send --session --type=method_call --print-reply --dest=org.cinnamon.ScreenSaver /org/cinnamon/ScreenSaver org.cinnamon.ScreenSaver.Lock string:");<br>
<br>
* Suspend / Hibernate must now activated per systemctl. T. m.:<br>
Util.spawnCommandLine("systemctl suspend -i");<br>
resp.<br>
Util.spawnCommandLine("systemctl hibernate -i");<br>
<br>
(Note: "-i" ignores any "inhibitors", t. m. active sessions of other users. You can try without it.)<br>
<br>
* Reboot. Although the item performs a reboot, it doesn't perform a proper reboot, e. g. running applications have no chance to save their data. Better use:<br>
Util.spawnCommandLine("dbus-send --session --type=method_call --print-reply --dest=org.gnome.SessionManager /org/gnome/SessionManager org.gnome.SessionManager.Logout uint32:1");<br>
<br>
* Shutdown dto.:<br>
Util.spawnCommandLine("dbus-send --session --type=method_call --print-reply --dest=org.gnome.SessionManager /org/gnome/SessionManager org.gnome.SessionManager.RequestShutdown");<br>
<br>
You may test all commands on the command line first.
-
9 months ago
@Grigorij: I had the same problem. You can change the commands in the file "applet.js", e. g.:

vi ${HOME}/.local/share/cinnamon/applets/ShutdownApplet@shelley/applet.js
(or gedit / xed instead of vi).

* Screen Lock: The lock-Method needs now a string parameter. Append "string:" to the command, the new line looks like:
Util.spawnCommandLine("dbus-send --session --type=method_call --print-reply --dest=org.gnome.ScreenSaver /org/gnome/ScreenSaver org.gnome.ScreenSaver.Lock string:");

If you use Linuxmint 18 Cinnamon, you have to change the command as following:
Util.spawnCommandLine("dbus-send --session --type=method_call --print-reply --dest=org.cinnamon.ScreenSaver /org/cinnamon/ScreenSaver org.cinnamon.ScreenSaver.Lock string:");

* Suspend / Hibernate must now activated per systemctl. T. m.:
Util.spawnCommandLine("systemctl suspend -i");
resp.
Util.spawnCommandLine("systemctl hibernate -i");

(Note: "-i" ignores any "inhibitors", t. m. active sessions of other users. You can try without it.)

* Reboot. Although the item performs a reboot, it doesn't perform a proper reboot, e. g. running applications have no chance to save their data. Better use:
Util.spawnCommandLine("dbus-send --session --type=method_call --print-reply --dest=org.gnome.SessionManager /org/gnome/SessionManager org.gnome.SessionManager.Logout uint32:1");

* Shutdown dto.:
Util.spawnCommandLine("dbus-send --session --type=method_call --print-reply --dest=org.gnome.SessionManager /org/gnome/SessionManager org.gnome.SessionManager.RequestShutdown");

You may test all commands on the command line first.
-
11 months ago
Ubuntu 16.04 with cinnamon 3
Only logout works. Other buttons do nothing. What can I do?
-
11 months ago
I am using it in arch. Only logout works. Other buttons do nothing. What can I do?
-
1 year ago
Hibernate doesn't work. Made me waste a few hours troubleshooting it. Nice idea, poor execution.
-
2 years ago
would be nice to work with 1 click action.
for example with right click to set the default action, let's say shutdown
and so, if I press with left click - directly close linux, without another menu to pop out and another click to close it.
-
3 years ago
Awesome! Thanx
-
3 years ago
Great little applet!
Finally no more clicking on three different places of the screen to poweroff.

Is there a way to connect this with a keyboard shortcut or do I need to learn how to do macros?

/Anders
-
3 years ago
Fixed version can be downloaded here: http://cinnamon-spices.linuxmint.com/applets/view/159
-
3 years ago
If you want to fix the lock screen in linux mint 15 olivia
locate the applet.js in ~/home/<username>/.local/share/cinnamon/applets/ShutdownApplet@shelley

for a working lock screen and hibernate mode change following parts in der applet.js:

// Screen Lock
this.menu.addAction(_("Screen Lock"), function(event) {
//Util.spawnCommandLine("dbus-send --session --type=method_call --print-reply --dest=org.gnome.ScreenSaver /org/gnome/ScreenSaver org.gnome.ScreenSaver.Lock"); // old Screen Lock command

Util.spawnCommandLine("gnome-screensaver-command -l"); // Screen Lock command
});

//Hibernate
this.menu.addAction(_("Hibernate"), function(event) {
Util.spawnCommandLine("gnome-screensaver-command -l"); // Screen Lock command
Util.spawnCommandLine("dbus-send --print-reply --system --dest=org.freedesktop.UPower /org/freedesktop/UPower org.freedesktop.UPower.Hibernate"); // Hibernate command
});
-
3 years ago
The lock screen seems to be broken since Cinnamon 1.8, it just doesn't do anything when clicked
-
3 years ago
Trying to use this with ubuntu 12.04 and cinnamon and the lock function is not working, although lock from the main menu is, as well as ctl alt l
-
3 years ago
I think this could be improved with a switch user function too, is such a thing possible, I modified the applet.js to include a line for switch user but it just uses the command gdmflexiserver, I don't know how this would behave with MDM because I dont use it
-
4 years ago
Love this applet, thanks.
It's the first one I set up.
The one click feature is key for me. My menu hangs before appearing which makes getting to shutdown, or restart, a pain; that plus, less clicks to get on with it.
Once again, I certainly appreciate your time and effort.
-
4 years ago
Great applet! But as other users already stated, for distributions that don't use ConsoleKit any more like Fedora or Arch Linux, not all of the options are working. I'm using Arch and they even removed ConsoleKit from the repositories and strongly discourage to use it any more. So the correct solution is using systemd: it provides the commands "systemctl poweroff|suspend|hibernate|reboot". No need for ConsoleKit anymore.
-
4 years ago
I have a problem: if I click hibernate, it just suspends, but I can hibernate just fine with all other ways... do you have any idea what's not working?
-
4 years ago
thanks!

both "hibernate" and "suspend" call the same command:

dbus-send --print-reply --system --dest=org.freedesktop.UPower /org/freedesktop/UPower org.freedesktop.UPower.Hibernate

i think, "suspend" should rather use the parameter "org.freedesktop.UPower.Suspend", shouldn't it?

dbus-send --print-reply --system --dest=org.freedesktop.UPower /org/freedesktop/UPower org.freedesktop.UPower.Suspend
-
4 years ago
Hi Shelley,
In order to support l10n add the following statements after the section of constants:

const Gettext = imports.gettext;
const _ = Gettext.gettext;
const UUID = 'ShutdownApplet@shelley';


Gettext.textdomain(UUID);
Gettext.bindtextdomain(UUID, GLib.get_home_dir() +"/.local/share/locale");
-
4 years ago
This is a great job you've done but nothing is perfection on planet Earth ^^
I'm a french guy and the translation for the Screen Lock, Hibernate and Shutdown function doesn't work for me.
It would be great if you add 2 other functions :

- mdmflexiserver in order to change user without log out the current session
- shutdown -t XX in order to shutdown after a timeout.

Thanks.
-
4 years ago
Shelley, great job!
This will always have a place on my panel right next to the menu.
Thanks.
-
4 years ago
I found the issue with Fedora. Turns out that the consolekit is removed from Fedora 17.
yum install ConsoleKit ConsoleKit-x11
systemctl enable console-kit-daemon.service
systemctl start console-kit-daemon.service
Now the shutdown/restart buttons work like they should.
-
4 years ago
Nice applet, but unfortunately the shutdown and restart options do not work for me. I am using cinnamon on Fedora 17. I believe the issue is that by default fedora does not add users to the sudo list and give them permission to issue commands to terminate sessions without prompting for passwords.
-
4 years ago
Something like this should come stock with Cinnamon.
-
4 years ago
Great job !!
-
4 years ago
Exactly what I was looking for..Thank you..
-
4 years ago
Great extension Shelley
I dislike the confirmation pop-up box.
This extension fixes that for me.

One request could you add a switch user to the list?
Or can someone tell me how to add it?

Thanks for the extension.
-
4 years ago
Thanks for exactly what I was looking for. All-In-One and no confirmation. :-)
-
5 years ago
Very useful Applet.
-
5 years ago
i just noticed now that 'logout' is just as laggy as with other applets. but not using it very often so dont really care :)
-
5 years ago
Fantastic Applet. Shutdowns and restarts pretty fast. Five stars fro m me :)
-
5 years ago
Actually use this applet every day, I is very useful. You could add small icons in each item, to make it easier to identify visually. Anyway very nice applet!.
-
5 years ago
Added to Cinnamon Extras PPA:<br />
--<br />
sudo add-apt-repository ppa:bimsebasse/cinnamonextras<br />
sudo apt-get update && sudo apt-get install cinnamon-applet-shutdown<br />
--
-
5 years ago
@bimsebasse Thank you for trying it and for understanding that it is much more than adding a "restart" to an existing applet :)
-
5 years ago
OK, bypassing the gtk popup does make this more than different than just adding restart, I also dislike confirmation dialogs probably as much as you so it's all good :o) Hope it's OK I add this to the Cinnamon Extras PPA next update.
-
5 years ago
@bownz Sure...will mail you buddy when I get time...Bit busy with an upcoming project..
@billynick Thank you for trying the applet and for your comments....
@mikefreeman I have taken your Criticism with a positive frame of mind...since I was 100% confident about the efficiency of my applet...No problem :)
-
5 years ago
@Shelley, thanks for the info, as I do not have a permanent, functioning Cinnamon running right now to test it on. I'm on Mint 10 until at least 13 LTS comes out, and my VirtualBox install of Mint 12/Cinnamon is incredibly unstable (crashes Cinnamon constantly, and logout freezes up my whole system, even outside of VB). I did not mean to start a controversy, though! Wow, such excitement! :)
-
5 years ago
Well my intent right now is to make a popup menu appear when I click that, and design the popup menu to us the command shutdown now, or restart now. I will fix that issue in my applet. Promise ;p
-
5 years ago
@bownz, the same lag happens if i use the logout/shutdown from the mint menu. it must be the code implemented into that dialog...not your applet i would think
-
5 years ago
billynick, My computer does not do that. I shall look into the issue, and try to fix it in my applet, WITH the popups. Maybe not THAT pop up, I might make my own popup. Thank you.
-
5 years ago
Shelley, would you mind emailing me sometime? I love hearing input from other Developers, because I am new to this sort of thing. If so hit me up at bendloveless@gmail.com (I will not be able to reply for up to 8 hours)
-
5 years ago
5 stars from me, i prefer it this way :) mostly cos the old way made logout/restart/shutdown take forever on my and some other peoples systems. see this thread http://forums.linuxmint.com/viewtopic.php?f=208&t=99229 . i dont mind the dialog popping up but, well i dont know, this shuts down my pc instantly, the other applet(s) means i have to wait more than 30 seconds before anything happens
-
5 years ago
@bownz We use it for our development systems...some of the usesr may find it useful, as we do...In open source software there is no competition....The users can choose and adapt the software according to their needs...Bownz..thank you for your comment, buddy...
-
5 years ago
The one click shut down and restart buttons are not the best. They could easily be clicked by accident, thus causing the computer to restart during important tasks. I recommend deciding which is better for the set user. This is a nice applet, I admit, this is not competition, so please don't compare Shelley's applet to my own. This applet has it's different functions. "Great minds think alike"
-
5 years ago
Please note that the commands are different and more efficient....It is not the same applet as Quit Applet...Please read the code before commenting.....All of the commands provide one click operations and the applet is not simply "restart" added to another applet...

I request you to try both the applets before commenting....
-
5 years ago
is not the same applet bownz try it first
-
5 years ago
I think it would have been more practical to ask bownz to add "restart" rather than make the exact same applet with restart added.
-
5 years ago
@mikefreeman

This Applet has slightly more functionality than Quit Applet...Does the quit Applet has Restart or Shutdown on single click...We have customized it for our systems and hoped to share it....:)
-
5 years ago
Nice, but isn't this basically a duplication of the functionality in the Quit Applet by bownz?