Go to your favorite terminal and type sudo apt install xterm
We are going to add our script to our keyboard shortcuts, to do this, it's very simple, search in the shortcuts
applications normally, it should show you the keyboard application, then you go to the application and you go to the 'shortcuts tab and normally you should find Add a keyboard shortcut
, you click on it and there you will enter the keys you want to run the script (I, for my part, put CTRL + ALT + X
) and then they will ask you for the command, it gets a bit complicated, but don't worry, you will enter xterm -e "/path/shutdown.sh" and you will save it, go there now, test, if it doesn't work either you entered the wrong path or you don't have superuser rights.
And now, isn't it more convenient to have to press a keyboard shortcut and type a y and validate to turn off?