Showing posts with label shortcut. Show all posts
Showing posts with label shortcut. Show all posts

Wednesday, February 19, 2014

Add keyboard shortcut for shutdown dialog

If you want to add a custom keyboard shortcut to open the shutdown menu, you have to:

  • go on Menu --> Keyboard, and then on the "Shortcuts" tab
  • click on the "+" button
  • give a name you desire and the following command:  gnome-session-quit --power-off
  • Select the new shortcut and press the key combination you want to assign to it
  • Close, and you're done!
You may find also this post useful: How to add hibernate option to Mint 13

Monday, November 12, 2012

How to use commands with options in shortcuts / at startup

Running a shell command that has some options (command -opt) at startup or with a keyboard shortcut may not work, so the only solution is to create a bash script with the desired command inside and launch the script instead.
Here is what you have to do (assuming the script will be named myscript, your command is mycomm and has option -opt):

  • in a Terminal (CTRL+ALT+T) type gedit myscript (or another editor instead of gedit)
  • copy and paste the following code inside:
    #! /bin/bash
    mycomm -opt
  • save and close
  • in the Terminal type chmod +x myscript to make it executable
  • move the file in /usr/bin to make it runnable: sudo cp -a myscript /usr/bin
  • add /usr/bin/myscript as command to the startup processes or to your customized keyboard shortcuts.