If you work in the console, you can re-define the keyboard-mappings of any key, so that this key executes any command of your choice.
For this to work, you first need to find out the keycode of the desired key, e.g. F12. You do this by executing
showkey, and then pressing F12. Showkey will now show you this output:
press any key (program terminates after 10s of last key press).
keycode 28 release
keycode 88 press
keycode 88 release
Keycode 28 (release) means that you just released your ENTER-key.
Keycode 88 (press and release) is shown because you just pressed and released F12.
showkey command will end after you have waited 10 seconds without pressing any key.
Repeat this procedure as often as necessary to find out all the keycodes you need.
Now we can change the so-called Kernel String Table , by issuing the command
loadkeys, and then entering your strings.
keycode 88 = F12
keycode 125 = F40
string F12 = "ls\n"
string F40 = "mikmod -rp /usr/local/data/mod/*.mod\n"
Now press CTRL-d to leave loadkeys. That's it.
Everytime you press F12 you will get the output of ls on your console, and everytime you press the left Windows-key (keycode 125) mikmod, my favorite MOD-player, will be started.
You can now execute your favorite (console-)applications with just one keypress.
You can of course automate this whole precess. Just put your "keycode"- and "string"-lines in a file, say
~/.keystrings, and put a similar line in your
boot.local or a similar file:
Now everytime you reboot your computer, your key-settings are automatically loaded.
You all know you can change from one text console to another using
ALT-Fx, where x is a number from 1 to 7 (or even higher, depending on your configuration).
What is not so widely known, is that you can also change consoles with a nifty little program called
chvt 3 (this switches to console 3)
There are several reasons why this utility can be quite handy: First, you might want to write shell/perl/whatever scripts which switch the consoles, which you can do now. Second, if something with your X11 keyboard configuration screws up (e.g. ALT-keys don't work anymore) or something similar, you can still switch to a console.
Here's a short description of how you can disable those annoying beeps in the console and in an X11 session.
setterm -blength 0
setterm -blength 200
xset b off
xset b on
You can use the
psnup utility from the psutils package to print several pages of one Postscript file to the same sheet of paper.
psnup -2 input.ps output.ps
psnup -4 input.ps output.ps
There's also a
pdfnup utility in the pdfjam package which can do the same thing with PDFs.
If you want to run two or more X11 sessions on the same computer at the same time, you can do the following:
startx -- :1to start a second X11 session
8:23:respawn:/sbin/getty 38400 tty8
startx -- :2to start a third X11 session etc.