PDA

View Full Version : [other] ubuntu + i3 - shutdown command



tango2
February 27th, 2014, 04:20 PM
Hello,

I recently decided to give i3 a try and installed it on my ubuntu laptop. I have spend some time both using it and trying to tweak it, and i absolutely love it.

However, the i3 only contains a command for logout and not quit, so i found a small script for boot shutting down and rebooting.



shutdown)
systemctl poweroff
;;


but ubuntu does not implement the systemctl. How can i create a script that could shuts down / reboots without it?

lukeiamyourfather
February 27th, 2014, 08:09 PM
The command I typically use is this.


sudo shutdown -h now

tango2
March 8th, 2014, 11:44 PM
That definitely does the trick, but is it possible to add the "sudo command" in a shortcut, so i dont have to start a terminal and type the password.

Probably a bit demanding now. :)

3rdalbum
March 9th, 2014, 05:38 AM
Use 'gksudo halt' in a script, or make the script owned by root and use the 'setuid' permission to make the script run as root automatically.