13.07.2015 Views

Linux System Administration Recipes A Problem-Solution Approach

Linux System Administration Recipes A Problem-Solution Approach

Linux System Administration Recipes A Problem-Solution Approach

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

CHAPTER 9 ■ WORKING WITH TEXT IN FILESIf you want to change the Mode_switch key (or any other key), put a line in the file ~/.Xmodmap likethis:keycode 119 = Mode_switch Mode_switch119 is the F12 key.Next, take a look at your existing keyboard map, with xmodmap -pk | less. The output will start off abit like this:There are 4 KeySyms per KeyCode; KeyCodes range from 8 to 255.KeyCode Keysym (Keysym) ...Value Value (Name) ...8 0x0061 (a) 0x0041 (A) 0x00e5 (aring) 0x00c5 (Aring)9 0x0073 (s) 0x0053 (S) 0x00df (ssharp) 0x00cd (Iacute)10 0x0064 (d) 0x0044 (D) 0x08ef (partialderivative) 0x00ce(Icircumflex)11 0x0066 (f) 0x0046 (F) 0x08f6 (function) 0x00cf (Idiaeresis)12 0x0068 (h) 0x0048 (H) 0x01ff (abovedot) 0x00d3 (Oacute)The first column is the keycode (in decimal, as discussed earlier). The remaining columns give thefour-digit hex code of the symbol that will be entered via this key being pressed in various circumstances(and then the actual name of the symbol in brackets). The first column is just the key, the second is key-Shift, the third is key-Mode_switch (usually Alt-Gr, as discussed earlier), and the fourth is key-Mode_switch-Shift.So here, my A key has keycode 8, which will produce a on its own, A with Shift, å with Alt-Gr, and Åwith Alt-Gr+Shift.OK, let’s say that we want to change one of these settings: I want my d key (keycode 10) to produce adegree symbol (°) when hit together with Alt-Gr. Create or edit a file called ~/.Xmodmap that looks like this:keysym d = d NoSymbol 0x00B0NoSymbolThis sets the key to produce d when hit on its own, nothing when hit with Shift (so the existingkeymap will apply instead, and you’ll get D), ° when hit with Alt-Gr, and whatever the existing keymapsays when hit with Alt-Gr+Shift (in this case, ī). Load this keyfile with the following, and give it a go:xmodmap ~/.XmodmapIn this case, you could also replace 0x00B0 with the name of the symbol (degree) for the same result,which might be more readable. Tables of UTF-8 hex codes are available online.198Download at WoweBook.Com

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!