How can I safely shutdown/reboot/logout KDE from the command line?
I am not talking about shutdown
and reboot
commands. I want to initiate the same routine from command line that would be performed if I would press the logout/reboot/shutdown button inside the KDE desktop.
kde command-line shutdown reboot
add a comment |
I am not talking about shutdown
and reboot
commands. I want to initiate the same routine from command line that would be performed if I would press the logout/reboot/shutdown button inside the KDE desktop.
kde command-line shutdown reboot
I dont know if you could do that. one of the commands would eventually close the terminal your using to interact with it. Maybe more ideas on why you need to do this? :)
– myusuf3
Aug 10 '10 at 18:51
I need to do this because plasma-desktop is acting up sometimes and I still want to keep the session information that is saved during logout
– txwikinger
Aug 10 '10 at 20:39
add a comment |
I am not talking about shutdown
and reboot
commands. I want to initiate the same routine from command line that would be performed if I would press the logout/reboot/shutdown button inside the KDE desktop.
kde command-line shutdown reboot
I am not talking about shutdown
and reboot
commands. I want to initiate the same routine from command line that would be performed if I would press the logout/reboot/shutdown button inside the KDE desktop.
kde command-line shutdown reboot
kde command-line shutdown reboot
edited Aug 18 '10 at 0:57
Marco Ceppi♦
37.1k24154192
37.1k24154192
asked Aug 10 '10 at 18:48
txwikingertxwikinger
19.4k106593
19.4k106593
I dont know if you could do that. one of the commands would eventually close the terminal your using to interact with it. Maybe more ideas on why you need to do this? :)
– myusuf3
Aug 10 '10 at 18:51
I need to do this because plasma-desktop is acting up sometimes and I still want to keep the session information that is saved during logout
– txwikinger
Aug 10 '10 at 20:39
add a comment |
I dont know if you could do that. one of the commands would eventually close the terminal your using to interact with it. Maybe more ideas on why you need to do this? :)
– myusuf3
Aug 10 '10 at 18:51
I need to do this because plasma-desktop is acting up sometimes and I still want to keep the session information that is saved during logout
– txwikinger
Aug 10 '10 at 20:39
I dont know if you could do that. one of the commands would eventually close the terminal your using to interact with it. Maybe more ideas on why you need to do this? :)
– myusuf3
Aug 10 '10 at 18:51
I dont know if you could do that. one of the commands would eventually close the terminal your using to interact with it. Maybe more ideas on why you need to do this? :)
– myusuf3
Aug 10 '10 at 18:51
I need to do this because plasma-desktop is acting up sometimes and I still want to keep the session information that is saved during logout
– txwikinger
Aug 10 '10 at 20:39
I need to do this because plasma-desktop is acting up sometimes and I still want to keep the session information that is saved during logout
– txwikinger
Aug 10 '10 at 20:39
add a comment |
4 Answers
4
active
oldest
votes
For kde4:
qdbus org.kde.ksmserver /KSMServer org.kde.KSMServerInterface.logout -1 -1 -1
The three integer parameters are the confirm
, sdtype
and sdmode
arguments to KWorkSpace::requestShutDown. Their values are explained at the top of the page.
Gilles' answer helped me as well. Just a small note there: it doesn't work from su. In my case this was part of a command issued using sudo. In that case it doesn't work. ComplainsCannot find 'org.kde.KSMServerInterface.logout' in object /KSMServer at org.kde.ksmserver
. However works very well when run with the regular user ^_^
– user3099609
Feb 10 '14 at 8:29
add a comment |
For any version of KDE (maybe also GNOME and others):
In KDE Control Center (KDE3.5/trinity) you can set a keyboard shortcut for "halt without confirmation" (should be a complicated one to avoid tragedy, like Ctrl+Shift+Alt+Delete) and then run xvkbd
(virtual keyboard):
xvkbd -text 'CSAd'
You can create an alias for this (e.g. kdehalt
);
My favourite one: sleep 1h 20m && kdehalt
or wget "http://something" ; kdehalt
.
add a comment |
So I tried the answer presented by Gilles, but that only works for KDE4.
After a system-update with my graphics, I could no longer log out, reboot, or shutdown. Eventually found this command worked:
qdbus org.kde.ksmserver /KSMServer logout 0 0 0
My source is from here, where they discuss it a bit more. I'm not sure about he other optoins. Forum topic discussion KDE5 shutdown options. The above command seems to have shutdown my system gracefully. All my programs came back that were expected, in the right layout order, and I did not seem to be missing anything. If this doesn't work, please comment and I will adjust my answer but so far this is all that has worked for a graceful KDE5 shutdown when my is locked. (I obviously could have used the shutdown command or called init, but those aren't graceful.)
New contributor
add a comment |
I usually use init command for restart and ... .
I like this command
# Default run level. The run levels are:
# 0 - halt (Do NOT set initdefault to this)
# 1 - Single user mode
# 2 - Multiuser, without NFS
# (The same as 3, if you do not have networking)
# 3 - Full multiuser mode
# 4 - unused
# 5 - X11
# 6 - reboot (Do NOT set initdefault to this)
sjb@sjb-laptop~$ init 6
4
This does not shutdown the desktop gracefully
– txwikinger
Aug 10 '10 at 20:40
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "89"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1871%2fhow-can-i-safely-shutdown-reboot-logout-kde-from-the-command-line%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
4 Answers
4
active
oldest
votes
4 Answers
4
active
oldest
votes
active
oldest
votes
active
oldest
votes
For kde4:
qdbus org.kde.ksmserver /KSMServer org.kde.KSMServerInterface.logout -1 -1 -1
The three integer parameters are the confirm
, sdtype
and sdmode
arguments to KWorkSpace::requestShutDown. Their values are explained at the top of the page.
Gilles' answer helped me as well. Just a small note there: it doesn't work from su. In my case this was part of a command issued using sudo. In that case it doesn't work. ComplainsCannot find 'org.kde.KSMServerInterface.logout' in object /KSMServer at org.kde.ksmserver
. However works very well when run with the regular user ^_^
– user3099609
Feb 10 '14 at 8:29
add a comment |
For kde4:
qdbus org.kde.ksmserver /KSMServer org.kde.KSMServerInterface.logout -1 -1 -1
The three integer parameters are the confirm
, sdtype
and sdmode
arguments to KWorkSpace::requestShutDown. Their values are explained at the top of the page.
Gilles' answer helped me as well. Just a small note there: it doesn't work from su. In my case this was part of a command issued using sudo. In that case it doesn't work. ComplainsCannot find 'org.kde.KSMServerInterface.logout' in object /KSMServer at org.kde.ksmserver
. However works very well when run with the regular user ^_^
– user3099609
Feb 10 '14 at 8:29
add a comment |
For kde4:
qdbus org.kde.ksmserver /KSMServer org.kde.KSMServerInterface.logout -1 -1 -1
The three integer parameters are the confirm
, sdtype
and sdmode
arguments to KWorkSpace::requestShutDown. Their values are explained at the top of the page.
For kde4:
qdbus org.kde.ksmserver /KSMServer org.kde.KSMServerInterface.logout -1 -1 -1
The three integer parameters are the confirm
, sdtype
and sdmode
arguments to KWorkSpace::requestShutDown. Their values are explained at the top of the page.
edited Jun 16 '17 at 19:33
Oleh Prypin
1,98821829
1,98821829
answered Aug 10 '10 at 19:51
GillesGilles
45.2k13102141
45.2k13102141
Gilles' answer helped me as well. Just a small note there: it doesn't work from su. In my case this was part of a command issued using sudo. In that case it doesn't work. ComplainsCannot find 'org.kde.KSMServerInterface.logout' in object /KSMServer at org.kde.ksmserver
. However works very well when run with the regular user ^_^
– user3099609
Feb 10 '14 at 8:29
add a comment |
Gilles' answer helped me as well. Just a small note there: it doesn't work from su. In my case this was part of a command issued using sudo. In that case it doesn't work. ComplainsCannot find 'org.kde.KSMServerInterface.logout' in object /KSMServer at org.kde.ksmserver
. However works very well when run with the regular user ^_^
– user3099609
Feb 10 '14 at 8:29
Gilles' answer helped me as well. Just a small note there: it doesn't work from su. In my case this was part of a command issued using sudo. In that case it doesn't work. Complains
Cannot find 'org.kde.KSMServerInterface.logout' in object /KSMServer at org.kde.ksmserver
. However works very well when run with the regular user ^_^– user3099609
Feb 10 '14 at 8:29
Gilles' answer helped me as well. Just a small note there: it doesn't work from su. In my case this was part of a command issued using sudo. In that case it doesn't work. Complains
Cannot find 'org.kde.KSMServerInterface.logout' in object /KSMServer at org.kde.ksmserver
. However works very well when run with the regular user ^_^– user3099609
Feb 10 '14 at 8:29
add a comment |
For any version of KDE (maybe also GNOME and others):
In KDE Control Center (KDE3.5/trinity) you can set a keyboard shortcut for "halt without confirmation" (should be a complicated one to avoid tragedy, like Ctrl+Shift+Alt+Delete) and then run xvkbd
(virtual keyboard):
xvkbd -text 'CSAd'
You can create an alias for this (e.g. kdehalt
);
My favourite one: sleep 1h 20m && kdehalt
or wget "http://something" ; kdehalt
.
add a comment |
For any version of KDE (maybe also GNOME and others):
In KDE Control Center (KDE3.5/trinity) you can set a keyboard shortcut for "halt without confirmation" (should be a complicated one to avoid tragedy, like Ctrl+Shift+Alt+Delete) and then run xvkbd
(virtual keyboard):
xvkbd -text 'CSAd'
You can create an alias for this (e.g. kdehalt
);
My favourite one: sleep 1h 20m && kdehalt
or wget "http://something" ; kdehalt
.
add a comment |
For any version of KDE (maybe also GNOME and others):
In KDE Control Center (KDE3.5/trinity) you can set a keyboard shortcut for "halt without confirmation" (should be a complicated one to avoid tragedy, like Ctrl+Shift+Alt+Delete) and then run xvkbd
(virtual keyboard):
xvkbd -text 'CSAd'
You can create an alias for this (e.g. kdehalt
);
My favourite one: sleep 1h 20m && kdehalt
or wget "http://something" ; kdehalt
.
For any version of KDE (maybe also GNOME and others):
In KDE Control Center (KDE3.5/trinity) you can set a keyboard shortcut for "halt without confirmation" (should be a complicated one to avoid tragedy, like Ctrl+Shift+Alt+Delete) and then run xvkbd
(virtual keyboard):
xvkbd -text 'CSAd'
You can create an alias for this (e.g. kdehalt
);
My favourite one: sleep 1h 20m && kdehalt
or wget "http://something" ; kdehalt
.
edited Oct 2 '15 at 6:16
kos
25.8k871121
25.8k871121
answered Oct 24 '11 at 22:56
Zdeněk VálekZdeněk Válek
311
311
add a comment |
add a comment |
So I tried the answer presented by Gilles, but that only works for KDE4.
After a system-update with my graphics, I could no longer log out, reboot, or shutdown. Eventually found this command worked:
qdbus org.kde.ksmserver /KSMServer logout 0 0 0
My source is from here, where they discuss it a bit more. I'm not sure about he other optoins. Forum topic discussion KDE5 shutdown options. The above command seems to have shutdown my system gracefully. All my programs came back that were expected, in the right layout order, and I did not seem to be missing anything. If this doesn't work, please comment and I will adjust my answer but so far this is all that has worked for a graceful KDE5 shutdown when my is locked. (I obviously could have used the shutdown command or called init, but those aren't graceful.)
New contributor
add a comment |
So I tried the answer presented by Gilles, but that only works for KDE4.
After a system-update with my graphics, I could no longer log out, reboot, or shutdown. Eventually found this command worked:
qdbus org.kde.ksmserver /KSMServer logout 0 0 0
My source is from here, where they discuss it a bit more. I'm not sure about he other optoins. Forum topic discussion KDE5 shutdown options. The above command seems to have shutdown my system gracefully. All my programs came back that were expected, in the right layout order, and I did not seem to be missing anything. If this doesn't work, please comment and I will adjust my answer but so far this is all that has worked for a graceful KDE5 shutdown when my is locked. (I obviously could have used the shutdown command or called init, but those aren't graceful.)
New contributor
add a comment |
So I tried the answer presented by Gilles, but that only works for KDE4.
After a system-update with my graphics, I could no longer log out, reboot, or shutdown. Eventually found this command worked:
qdbus org.kde.ksmserver /KSMServer logout 0 0 0
My source is from here, where they discuss it a bit more. I'm not sure about he other optoins. Forum topic discussion KDE5 shutdown options. The above command seems to have shutdown my system gracefully. All my programs came back that were expected, in the right layout order, and I did not seem to be missing anything. If this doesn't work, please comment and I will adjust my answer but so far this is all that has worked for a graceful KDE5 shutdown when my is locked. (I obviously could have used the shutdown command or called init, but those aren't graceful.)
New contributor
So I tried the answer presented by Gilles, but that only works for KDE4.
After a system-update with my graphics, I could no longer log out, reboot, or shutdown. Eventually found this command worked:
qdbus org.kde.ksmserver /KSMServer logout 0 0 0
My source is from here, where they discuss it a bit more. I'm not sure about he other optoins. Forum topic discussion KDE5 shutdown options. The above command seems to have shutdown my system gracefully. All my programs came back that were expected, in the right layout order, and I did not seem to be missing anything. If this doesn't work, please comment and I will adjust my answer but so far this is all that has worked for a graceful KDE5 shutdown when my is locked. (I obviously could have used the shutdown command or called init, but those aren't graceful.)
New contributor
New contributor
answered 3 hours ago
C.D.C.D.
111
111
New contributor
New contributor
add a comment |
add a comment |
I usually use init command for restart and ... .
I like this command
# Default run level. The run levels are:
# 0 - halt (Do NOT set initdefault to this)
# 1 - Single user mode
# 2 - Multiuser, without NFS
# (The same as 3, if you do not have networking)
# 3 - Full multiuser mode
# 4 - unused
# 5 - X11
# 6 - reboot (Do NOT set initdefault to this)
sjb@sjb-laptop~$ init 6
4
This does not shutdown the desktop gracefully
– txwikinger
Aug 10 '10 at 20:40
add a comment |
I usually use init command for restart and ... .
I like this command
# Default run level. The run levels are:
# 0 - halt (Do NOT set initdefault to this)
# 1 - Single user mode
# 2 - Multiuser, without NFS
# (The same as 3, if you do not have networking)
# 3 - Full multiuser mode
# 4 - unused
# 5 - X11
# 6 - reboot (Do NOT set initdefault to this)
sjb@sjb-laptop~$ init 6
4
This does not shutdown the desktop gracefully
– txwikinger
Aug 10 '10 at 20:40
add a comment |
I usually use init command for restart and ... .
I like this command
# Default run level. The run levels are:
# 0 - halt (Do NOT set initdefault to this)
# 1 - Single user mode
# 2 - Multiuser, without NFS
# (The same as 3, if you do not have networking)
# 3 - Full multiuser mode
# 4 - unused
# 5 - X11
# 6 - reboot (Do NOT set initdefault to this)
sjb@sjb-laptop~$ init 6
I usually use init command for restart and ... .
I like this command
# Default run level. The run levels are:
# 0 - halt (Do NOT set initdefault to this)
# 1 - Single user mode
# 2 - Multiuser, without NFS
# (The same as 3, if you do not have networking)
# 3 - Full multiuser mode
# 4 - unused
# 5 - X11
# 6 - reboot (Do NOT set initdefault to this)
sjb@sjb-laptop~$ init 6
answered Aug 10 '10 at 20:01
Sajad BahmaniSajad Bahmani
822922
822922
4
This does not shutdown the desktop gracefully
– txwikinger
Aug 10 '10 at 20:40
add a comment |
4
This does not shutdown the desktop gracefully
– txwikinger
Aug 10 '10 at 20:40
4
4
This does not shutdown the desktop gracefully
– txwikinger
Aug 10 '10 at 20:40
This does not shutdown the desktop gracefully
– txwikinger
Aug 10 '10 at 20:40
add a comment |
Thanks for contributing an answer to Ask Ubuntu!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1871%2fhow-can-i-safely-shutdown-reboot-logout-kde-from-the-command-line%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
I dont know if you could do that. one of the commands would eventually close the terminal your using to interact with it. Maybe more ideas on why you need to do this? :)
– myusuf3
Aug 10 '10 at 18:51
I need to do this because plasma-desktop is acting up sometimes and I still want to keep the session information that is saved during logout
– txwikinger
Aug 10 '10 at 20:39