summaryrefslogtreecommitdiff
path: root/kde-logout
diff options
context:
space:
mode:
authorPeter Wu <lekensteyn@gmail.com>2013-04-23 18:59:15 +0200
committerPeter Wu <lekensteyn@gmail.com>2013-04-23 18:59:15 +0200
commitaf38cb02a9ca95b20056bc92e73fe72a45d1f523 (patch)
tree41628cac3a02d2c4dcf4ff6ecbb1fb8c5378db20 /kde-logout
downloadscripts-af38cb02a9ca95b20056bc92e73fe72a45d1f523.tar.gz
Initial checkin.
Diffstat (limited to 'kde-logout')
-rwxr-xr-xkde-logout16
1 files changed, 16 insertions, 0 deletions
diff --git a/kde-logout b/kde-logout
new file mode 100755
index 0000000..dee150a
--- /dev/null
+++ b/kde-logout
@@ -0,0 +1,16 @@
+#!/bin/sh
+# x = 0 = noconfirm, 1 = confirm
+# 0 2 0 = shutdown
+# 0 1 0 = restart
+# 0 0 0 = logoff?
+case $1 in
+l*) action=0 ;;
+r*) action=1 ;;
+s*) action=2 ;;
+*)
+ echo "Usage: $0 {logout|restart|shutdown}"
+ exit 1
+ ;;
+esac
+
+qdbus org.kde.ksmserver /KSMServer org.kde.KSMServerInterface.logout 0 $action 0