#!/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