bash: close kde with bash using qdbus


for kde 4.XX

qdbus org.kde.ksmserver /KSMServer logout 0 2 0

for kde 3.XX

dcop –all-users –all-sessions ksmserver ksmserver logout 0 2 0

logout 0 -1 -1

First parameter: confirm

Obey the user’s confirmation setting: -1
Don’t confirm, shutdown without asking:  0
Always confirm, ask even if the user turned it off: 1

Second parameter: type

Select previous action or the default if it’s the first time: -1
Only log out: 0
Log out and reboot the machine: 1
Log out and halt the machine: 2

Third parameter: mode

Select previous mode or the default if it’s the first time: -1
Schedule a shutdown (halt or reboot) for the time all active sessions have
exited: 0
Shut down, if no sessions are active. Otherwise do nothing: 1
Force shutdown. Kill any possibly active sessions: 2
Pop up a dialog asking the user what to do if sessions are still activ

suspend to ram kde 4

dbus-send --print-reply --dest='org.freedesktop.PowerManagement' /org/freedesktop/PowerManagement org.freedesktop.PowerManagement.Suspend 

article by

mail list
and
http://samwiseandthestereotypical.blogspot.com/

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: