Howto: graphical logout/shutdown/reboot in any Window Manager

One of the advantages of Linux is its origin as a server OS. That means that a normal user is just that…a normal user with limited privileges, without any access to the more important stuff of the OS, like the ability to install software for example, or change the clock, or…shut down the PC.

Now, the more user-friendly Linux distributions solve this problem quite easily by using KDE or Gnome. As I understand it, they both use a login manager (KDM or GDM), which also provides the functionality to shut down or reboot the PC. Of course, if you don’t use KDE or Gnome, the standard way to shutting down the PC is to open a terminal, login as root, and type “halt”, or something similar. It’s not really difficult, but far from elegant.

Okay, you could always install KDM or GDM separately, but most users use a window manager instead of a desktop environment to get rid of unnecessary clutter, and neither GDM nor KDM is exactly lightweight.

Many “power users” would argue that they always have a root terminal opened, so typing “halt” doesn’t really take much time, but I still think that a nice and simple GUI is more comfortable to a new linux user.

The solution? A simple-but-brilliant python script, posted in the Arch Linux forums. So we’re absolutely clear on this, it’s not written by me🙂 The author is Markus “Fightright” Verweyen, who also wrote a nice volume management script. He explains things rather nicely in his post, but I’ll repeat the most important stuff:

  • You need to have sudo and python installed
  • You need to unpack the files available here. Personally, I just dumped them in my /home
  • You need something like this in your /etc/sudoers file:

yourUserName ALL=(ALL) NOPASSWD:/sbin/shutdown

After that, it gets easy. On my system, I have linked a keyboard shortcut to /path/to/shutdown.py , and I also added an entry in the openbox menu. It looks very nice (it follows your gtk-theme), and very professional.

As you can see, it’s written for openbox, but it works in with any window manager, as long as you have python installed. IceWM for example, comes with its own “shutdown box”, but I think it’s ugly. I modified the script ever so slightly, and on the Arch/IceWM/Vista-ish machine it looks like this:

It’s not absolutely necessary, but having a GUI shutdown box is one of those little things that make my computing experience just a little bit nicer.

San

One Response to Howto: graphical logout/shutdown/reboot in any Window Manager

  1. […] Shutdown box I’ve been informed that in this post, the link to the shutdown box files is dead, so I zipped the files I have and put them on […]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: