summaryrefslogtreecommitdiff
path: root/kde-logout
diff options
context:
space:
mode:
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