Tuesday, April 30, 2024
 Popular · Latest · Hot · Upcoming
9
rated 0 times [  9] [ 0]  / answers: 1 / hits: 8241  / 3 Years ago, sat, august 7, 2021, 2:45:08

I would like to create a two hotkeys. First for terminating all procesess and shutdown the system and turn computer off.



I have tried something but it only logged me off and then I had to confirm I want to log off and then turn off computer manually.



The second one for simple log off.



What is the command I should type in keyboard/hotkey settings? Or should I make .sh file and run it? What command for running the file should I use then?



Thank you very much!


More From » xubuntu

 Answers
6

gksudo shutdown -h now would come to mind, but this command requires root privileges. To execute it you would have to enter you password.



Here's a command that should work without root and shut down your PC immediately (compatible with all official Ubuntu flavors):



dbus-send --system --print-reply --dest=org.freedesktop.ConsoleKit /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.Stop


These are Xubuntu-specific:




  • shutdown: xfce4-session-logout --halt

  • restart: xfce4-session-logout --reboot

  • log out: xfce4-session-logout --logout

  • suspend: xfce4-session-logout --suspend

  • hibernate: xfce4-session-logout --hibernate



Sources:



http://bbs.archbang.org/viewtopic.php?pid=9078#p9078



http://linux.die.net/man/1/xfce4-session-logout


[#29661] Sunday, August 8, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
riffnkful

Total Points: 390
Total Questions: 123
Total Answers: 110

Location: Puerto Rico
Member since Sat, Mar 13, 2021
3 Years ago
riffnkful questions
Thu, Nov 17, 22, 04:24, 1 Year ago
Mon, Nov 28, 22, 01:40, 1 Year ago
Mon, Jul 11, 22, 13:24, 2 Years ago
Sun, Feb 5, 23, 05:06, 1 Year ago
;