summaryrefslogtreecommitdiffstats
path: root/.zshrc
diff options
context:
space:
mode:
authorGravatar Tom Willemsen2011-10-17 00:07:14 +0200
committerGravatar Tom Willemsen2011-10-17 00:07:14 +0200
commit9e4506a7d2fc2dd0bae551ed2dd73794111ca957 (patch)
treec7196d21cd45427a96eb6d13e08401e0a9945861 /.zshrc
parent2bd25352862d1c6291fac4fd00d608df1a764385 (diff)
downloaddotfiles-9e4506a7d2fc2dd0bae551ed2dd73794111ca957.tar.gz
dotfiles-9e4506a7d2fc2dd0bae551ed2dd73794111ca957.zip
ZSH: Add user shutdown functions
These functions overwrite the executables reboot and shutdown
Diffstat (limited to '.zshrc')
-rw-r--r--.zshrc16
1 files changed, 16 insertions, 0 deletions
diff --git a/.zshrc b/.zshrc
index 4c8ca02..656bd9c 100644
--- a/.zshrc
+++ b/.zshrc
@@ -32,6 +32,22 @@ function line()
echo " $1"
}
+function shutdown()
+{
+ dbus-send --system --print-reply \
+ --dest="org.freedesktop.ConsoleKit" \
+ /org/freedesktop/ConsoleKit/Manager \
+ org.freedesktop.ConsoleKit.Manager.Stop
+}
+
+function reboot()
+{
+ dbus-send --system --print-reply \
+ --dest="org.freedesktop.ConsoleKit" \
+ /org/freedesktop/ConsoleKit/Manager \
+ org.freedesktop.ConsoleKit.Manager.Restart
+}
+
# Initialize colors.
autoload -U colors
colors