Is it possible to create a keyboard shortcut that will run:
shutdown -h now
When I press Ctrl + 9, for example.
|
Is it possible to create a keyboard shortcut that will run:
When I press Ctrl + 9, for example. |
||||
|
You can define two such shortcuts on the Linux console. Pressing Ctrl+Alt+Del sends the SIGINT signal to Note that these bindings may not be triggered while you're in X. Under X, you can use your window manager's key binding features, or another program such as xbindkeys. Note that under X, you don't get a free pass to run commands as root; if you want to trigger a reboot without entering a password, you'll need a (Aside: Ctrl+9 looks awfully easy to type by mistake. It's also a keyboard shortcut in several applications. Pick something rarer and with two modifiers!) |
|||
|
|
|
Something pretty similar does probably already work: see SysRq key sequences (see also the Linux kernel documentation). Some variant of |
|||
|
|
inittabcan be overridden by your WM/DE/OS. If you want it to be truly global, you will need to also configure your environment to allow it to act as so. – Chris Down Nov 6 '11 at 12:31