You are not logged in.
Hello guys,
I'd like to have a shortcut to shutdown my system via 'sudo shutdown -h now'. How could I extend my config.h to have such a feature on modkey-shift+s?
I've already searched the manpages but haven't found any examples how to launch command line functions.
Thank you in advance. ![]()
orschiro
Offline
Hello.
We can do that in that way:
Tell sudo that our user can turf off computer without password.
Add a keybinding for turn off computer like for
sudo poweroffShell Scripter | C/C++/Python/Java Coder | ZSH
Offline
static const char *shutcmd[] = { "sudo", "shutdown", "-h", "now", NULL };
static Key keys[] = {
/* modifier key function argument */
{ MODKEY|ShiftMask, , XK_s, spawn, {.v = shutcmd } },Add something like this to your config.h
Offline