From b5593ec19bf693c55e35f88bbce7b45a1381d986 Mon Sep 17 00:00:00 2001 From: Alexander Sulfrian Date: Thu, 8 Jan 2009 11:37:23 +0100 Subject: added some usefull scripts bin/Xshutdown.sh - graphical script for shutdown/reboot/standby sbin/set_governor - set the governor of both cpus sbin/keyword_package - adds a package to /etc/portage/packages.keywords sbin/asound_backup.sh - creates a backup of /etc/asound.conf sbin/asound_pulse_disable.sh - removes the default references to pulse sbin/asound_pulse_enable.sh - adds pcm.!default und ctl.!default references to pulse --- bin/Xshutdown.sh | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100755 bin/Xshutdown.sh (limited to 'bin') diff --git a/bin/Xshutdown.sh b/bin/Xshutdown.sh new file mode 100755 index 0000000..eeae1ba --- /dev/null +++ b/bin/Xshutdown.sh @@ -0,0 +1,34 @@ +#!/bin/sh +# export Display for GUI +export DISPLAY=":0.0" + +# Use as shutdown +SHUTDOWN=/sbin/shutdown + +case "$1" in + shutdown) + Xdialog --title Shutdown --center --beep --yesno "Really shutdown the system?" 0 0 \ + && (sync ; exec ${SHUTDOWN} -h now) + ;; + reboot) + Xdialog --title Reboot --center --beep --yesno "Do you want to reboot the system?" 0 0 \ + && (sync ; exec ${SHUTDOWN} -r now) + ;; + standby) + Xdialog -title Standby --center --beep --yesno "Do you want to suspend to ram?" 0 0 \ + && (sync ; exec hibernate-ram ) + ;; + ask) + CHOICE=$(Xdialog --stdout --title 'Choose!' --menubox 'Choose your destiny!' 10 50 3 \ + standby "Suspend to ram." \ + shutdown "Shutdown your system." \ + reboot " Reboot this system.") + [ -z "$CHOICE" ] && exit 1 + exec $0 $CHOICE + ;; + *) + echo $1 + echo 1>&2 "$0 (shutdown|reboot|standby|ask)" + exit 1 + ;; +esac -- cgit v1.2.3