Replies: 2 comments 1 reply
-
There are a couple of parts to this, but both are relatively easy. First, write two shell script (bash, zsh, ...) that contains the following:
and
And save them in $HOME/bin on your account and make them executable.
and
and assign them to hotkeys of your choice. That's the core of it, but there's probably more you need to do. If it requires sudo, then you have to get around that because sudo needs to interact with a terminal and you usually don't have one in focus when you press a hotkey. There are lots of ways to deal with this. One way is to add Another way would be to add some fancy GUI dialog code to either your bash or AutoKey scripts to ask for your password when they run. Sudo has a |
Beta Was this translation helpful? Give feedback.
-
And yet another way of doing it would be to write a reboot script and a shutdown script, neither of which requires sudo, and use whichever triggers you like for them. The reboot script:
The shut-down script:
|
Beta Was this translation helpful? Give feedback.
-
I just want to be able to shutdown or restart with a key combination. Can someone point me to a script to use? Thanks.
Beta Was this translation helpful? Give feedback.
All reactions