My Technical Blog - Minoria de Uno Solo


My notes on software programming and other IT areas. It emerges as a way to collect small notes that have been useful at some point.

Pyshutdown 

A graphical interface to Shutdown/reboot. Useful if your favourite WM hasn't that functionality. (i.e. OpenBox).

A very good guide to install/configure OpenBox: 

https://www.emezeta.com/articulos/openbox-personalizar-escritorio-linux

This project started like a personal needed due I use OpenBox everyday. I had a little bash script to automatize shutdown/reboot but it was ugly and It can't be cancelled.

It uses Tk-inter to the graphical interface. The language is autodetected (only english (default), spanish and german) and it's easy add new translations due to the .po/.mo translations files.

English:

German:

Spanish:

Due to debugging needs there is a command line parameter (-l) to write a log in /var/tmp

Dependencies

ti-inter

#apt-get install python-tk

User grants

User need to have enough privilegies to shutdown/reboot the machine:

Create a new group:

sudo groupadd power

Adding your user to the group power:

sudo usermod -a -G power yourusername

Allow members of group power to shutdown without a password:

sudo visudo

# Allow members of group sudo to execute any command
%sudo   ALL=(ALL:ALL) ALL
# Allow members of group power to shutdown (or reboot) system
%power  ALL = NOPASSWD: /sbin/shutdown

It is necessary re-login to the changes take effect.

 

 

My Technical Blog - Minoria de Uno Solo (2020)