Skip to content

Instantly share code, notes, and snippets.

@paraita
Last active December 14, 2015 09:28
Show Gist options
  • Save paraita/5065141 to your computer and use it in GitHub Desktop.
Save paraita/5065141 to your computer and use it in GitHub Desktop.
menu fluxbox pour eteindre l'ordi (linux)
#!/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