First thing, we can test to make sure this will work by running the following command:
$ xset dpms force off
That should turn off your laptop monitor until you move the mouse or type on the keyboard. Now to assign the keyboard shortcut, we need to open the configuration editor with the following command:
$ gconf-editor
You'll want to navigate the tree view on the left to the following path: /apps/metacity/keybinding_commnads. In the right panel you'll see that it lets you assign 12 commands (numbered 1 through 12). Just pick an empty one and assign it the following value:
xset dpms force off
Next you will want to find the following path on the tree view on the left: /apps/metacity/global_keybindings. Here you will see entries named run_command_x for x between 1 and 12. You will want to find the command that you edited earlier and in the Value space, type in the shortcut you want to run this with. For example, on the Mini 9, since Sleep is mapped to Fn+1, I decided to map this to Alt+1. To do this, I used the following value:
<Alt>1
Once you do that, you can test your keyboard shortcut and then close out of the configuration editor.
See you next time.
You can also do `xrandr --output .. --off`, I think that would be better. Annoyingly there is no --on, instead you must use --mode and re-provide the setting.
ReplyDelete