Last active
December 14, 2015 09:28
-
-
Save paraita/5065141 to your computer and use it in GitHub Desktop.
menu fluxbox pour eteindre l'ordi (linux)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# menu fluxbox pour eteindre l'ordinateur | |
# attention j'utilise zenity ici, sinon y'a un fallback x11 :) | |
## Zenity | |
# ans=$(zenity --width=40 --height=200 --title="Eteindre ?!" --list --text "Tu veux hoa éteindre ?!" --radiolist --column "Selection" --column "Choix" TRUE Eteindre FALSE Redémarrer); #echo $ans | |
# if [ "$ans" = "Eteindre" ]; then | |
# sudo shutdown | |
# fi | |
# if [ "$ans" = "Redémarrer" ]; then | |
# sudo reboot | |
# fi | |
## Fallback X11 | |
xmessage "Tu veux hoa eteindre labaleine ?!" -center -title "Choisir" -default "Annuler" -buttons "Annuler":1,"Redemarrer":2,"Eteindre":3 | |
case $? in | |
1) | |
echo "Exit";; | |
2) | |
sudo reboot;; | |
3) | |
sudo shutdown -h now;; | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment