[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: dpkg-reconfigure keyboard-configuration (Swedish with "|")



On Sat 11 May 2019 at 01:22:09 (+0200), Jonas Smedegaard wrote:
> > Den 2019-05-10 kl. 18:21, skrev David Wright:
> > > For example, I append lines to /etc/console-setup/remap.inc to do 
> > > things like enhancing the navigation keys, and preventing Alt-space 
> > > from producing NO-BREAK SPACE (because it's too easy to catch the 
> > > Alt by mistake). Little things like that.
> > > And in fvwm I have keys for audio control, taking screen shots, 
> > > capturing the screen as a movie, rotating the monitor with xrandr, 
> > > etc.
> 
> @David, if you care to share your personal tweaks then I am interested 
> in having a closer look, for inspiration and possibly for more general 
> use.

Sorry for the delay replying, but in view of my managing to get
stretch installed on the last of my machines, and with buster
coming up, I'd thought I'd do a bit of tidying.

The starting point for what I do is the composed characters that are
provided in X from /usr/share/X11/locale/en_US.UTF-8/Compose. So I
attempt to provide the same sequences to get the same characters on
the VC, just for ones that I personally use a lot.

The definitions go into /etc/console-setup/remap.inc, but AIUI you
have to include any default ones (which are mainly those for European
languages's diacriticals) because remap.inc overwrites them. I'm not
certain where the master list is, so   dumpkeys --compose-only   on
an unmodified system is the easiest way I've found to pick them up.

I failed to duplicate the X sequences for one or two characters,
I think because you're limited to two keystrokes after the Compose,
and possibly also to the Basic Multilingual Plane of Unicode. So,
for example, I use -- and __ on VCs in place of --. and --- on X
for the en and em dashes.

Then there are some common characters that aren't defined in X, so
I put those in ~/.XCompose (with matching ones in remap.inc). Again,
you have to respecify the system defaults, but in .XCompose you can
do it with an include (saving 6000 lines).

I also have a few more exotic characters that are only defined in
emacs using its ^X8 method, like diagonal, double, and double-headed
arrows.

All these work pretty much the same across all my machines/keyboards
(though I don't need £ and ¬ on my British ones). However, the fvwm
definitions vary much more because I try to match keys' functions
mnemonically with keycap engravings, and the latter vary widely,
particularly the coloured Fn keys on laptops.

So, for example, typing Sh-Alt-[☼+] or [☼-] (where Fn-[☼+] and [☼-]
increase and decrease brightness) starts or stops ffmpeg recording
of the whole screen as a movie, and Alt-[□■] (I don't remember what
Fn-[□■] is supposed to do) takes a screenshot of the whole screen.
Adding Shift- to the latter takes the screenshot after a delay.
Most keyboards have audio keys which X can recognise.

So my fvwm configuration files contains lines like:

Key	F1	A	C	Exec exec amixer -c 1 -- sset Master 0 mute
Key	F1	A	S	Exec exec amixer -c 1 -- sset Speaker 0 mute
Key	F1	A	CS	Exec exec amixer -c 1 -- sset Headphone 0 mute
Key	F2	A	C	Exec exec amixer -c 1 -- sset Master 5%- unmute
Key	F2	A	S	Exec exec amixer -c 1 -- sset Speaker 5%- unmute
Key	F2	A	CS	Exec exec amixer -c 1 -- sset Headphone 5%- unmute
Key	F3	A	C	Exec exec amixer -c 1 -- sset Master 5%+ unmute
Key	F3	A	S	Exec exec amixer -c 1 -- sset Speaker 5%+ unmute
Key	F3	A	CS	Exec exec amixer -c 1 -- sset Headphone 5%+ unmute

Key	F10	A	4	Maximize 100 100
Key	F10	A	M	Exec exec myfvwm-scrot-key-png.sh
Key	F10	A	SM	Exec exec myfvwm-scrot-key-png-delayed.sh
Key	F10	R	M	Exec exec myfvwm-scrot-key-root-png.sh
Key	F10	R	SM	Exec exec myfvwm-scrot-key-root-png-delayed.sh
Key	F11	A	4	Raise
Key	F11	A	M	-
Key	F11	A	SM	Exec exec myfvwm-killcapture.sh
Key	F12	A	4	Stick
Key	F12	A	M	-
Key	F12	A	SM	Exec exec myfvwm-capture.sh

# This performs Left/Right mouse clicks in an application (W: specifically for the browser,
# R: Left click in Root, but also activates Ctrl-Right click in Root!)
Key	Print	WR	N	FakeClick depth 0 press 1 wait 25 release 1
Key	Print	W	C	FakeClick depth 0 press 3 wait 25 release 3

I've attached some files mentioned.

Cheers,
David.
# /etc/console-setup/remap.inc last edited 2019-07-07
# The system-supplied file has only comments, so it can be replaced.
# After editing this file, run the following on a VC:
# dpkg-reconfigure console-setup
# If this file isn't perfectly correct, it will
# at best do nothing, and at worst screw things up.

# Ctrl-arrow keys need to send the same codes in VCs as in X/xterm.
Control keycode 105 = F51
string F51 = "\033[1;5D"
Control keycode 106 = F52
string F52 = "\033[1;5C"
Control keycode 108 = F53
string F53 = "\033[1;5B"
Control keycode 103 = F54
string F54 = "\033[1;5A"

# Alt-space (accidentally typed) may as well produce
# a space rather than nul Meta_nul or Meta_space.
alt keycode 57 = F41
string F41 = " "

# Preserve (for the time being) what I think are
# the defaults given on an intact system's VC by
# dumpkeys --compose-only
# though I've never determined where they originate.

compose '`' 'A' to U+00c0 # 'À'
compose '`' 'a' to U+00e0 # 'à'
compose '\'' 'A' to U+00c1 # 'Á'
compose '\'' 'a' to U+00e1 # 'á'
compose '^' 'A' to U+00c2 # 'Â'
compose '^' 'a' to U+00e2 # 'â'
compose '~' 'A' to U+00c3 # 'Ã'
compose '~' 'a' to U+00e3 # 'ã'
compose '"' 'A' to U+00c4 # 'Ä'
compose '"' 'a' to U+00e4 # 'ä'
compose 'o' 'A' to U+00c5 # 'Å'
compose 'o' 'a' to U+00e5 # 'å'
compose '*' 'A' to U+00c5 # 'Å'
compose 'A' '*' to U+00c5 # 'Å'
compose '*' 'a' to U+00e5 # 'å'
compose 'a' '*' to U+00e5 # 'å'
compose 'A' 'A' to U+00c5 # 'Å'
compose 'a' 'a' to U+00e5 # 'å'
compose 'A' 'E' to U+00c6 # 'Æ'
compose 'a' 'e' to U+00e6 # 'æ'
compose ',' 'C' to U+00c7 # 'Ç'
compose ',' 'c' to U+00e7 # 'ç'
compose '`' 'E' to U+00c8 # 'È'
compose '`' 'e' to U+00e8 # 'è'
compose '\'' 'E' to U+00c9 # 'É'
compose '\'' 'e' to U+00e9 # 'é'
compose '^' 'E' to U+00ca # 'Ê'
compose '^' 'e' to U+00ea # 'ê'
compose '"' 'E' to U+00cb # 'Ë'
compose '"' 'e' to U+00eb # 'ë'
compose '`' 'I' to U+00cc # 'Ì'
compose '`' 'i' to U+00ec # 'ì'
compose '\'' 'I' to U+00cd # 'Í'
compose '\'' 'i' to U+00ed # 'í'
compose '^' 'I' to U+00ce # 'Î'
compose '^' 'i' to U+00ee # 'î'
compose '"' 'I' to U+00cf # 'Ï'
compose '"' 'i' to U+00ef # 'ï'
compose '-' 'D' to U+00d0 # 'Đ'
compose '-' 'd' to U+00f0 # 'đ'
compose '~' 'N' to U+00d1 # 'Ñ'
compose '~' 'n' to U+00f1 # 'ñ'
compose '`' 'O' to U+00d2 # 'Ò'
compose '`' 'o' to U+00f2 # 'ò'
compose '\'' 'O' to U+00d3 # 'Ó'
compose '\'' 'o' to U+00f3 # 'ó'
compose '^' 'O' to U+00d4 # 'Ô'
compose '^' 'o' to U+00f4 # 'ô'
compose '~' 'O' to U+00d5 # 'Õ'
compose '~' 'o' to U+00f5 # 'õ'
compose '"' 'O' to U+00d6 # 'Ö'
compose '"' 'o' to U+00f6 # 'ö'
compose '/' 'O' to U+00d8 # 'Ø'
compose '/' 'o' to U+00f8 # 'ø'
compose '`' 'U' to U+00d9 # 'Ù'
compose '`' 'u' to U+00f9 # 'ù'
compose '\'' 'U' to U+00da # 'Ú'
compose '\'' 'u' to U+00fa # 'ú'
compose '^' 'U' to U+00db # 'Û'
compose '^' 'u' to U+00fb # 'û'
compose '"' 'U' to U+00dc # 'Ü'
compose '"' 'u' to U+00fc # 'ü'
compose '\'' 'Y' to U+00dd # 'Ý'
compose '\'' 'y' to U+00fd # 'ý'
compose 'T' 'H' to U+00de # 'Þ'
compose 't' 'h' to U+00fe # 'þ'
compose 's' 's' to U+00df # 'ß'
compose 'S' 'S' to U+1e9e # 'ẞ'
compose '"' 'y' to U+00ff # 'ÿ'
compose 'i' 'j' to U+0133 # 'ij'

# Add my definitions.

compose 'O' 'E' to U+0152 # 'Œ'
compose 'o' 'e' to U+0153 # 'œ'
compose '!' '!' to U+00a1 # '¡'
compose 'c' '/' to U+00a2 # '¢'
compose '/' 'c' to U+00a2 # '¢'
compose 'C' '|' to U+00a2 # '¢'
compose '|' 'C' to U+00a2 # '¢'
compose 'l' '-' to U+00a3 # '£'
compose '-' 'l' to U+00a3 # '£'
compose '=' 'e' to U+20ac # '€'
compose 'e' '=' to U+20ac # '€'
compose 'S' '!' to U+00a7 # '§'
compose 's' 'o' to U+00a7 # '§'
compose 'o' 's' to U+00a7 # '§'
compose 'C' 'O' to U+00a9 # '©'
compose 'O' 'C' to U+00a9 # '©'
compose 'c' 'o' to U+00a9 # '©'
compose 'o' 'c' to U+00a9 # '©'
compose '<' '<' to U+00ab # '«'
compose '-' ',' to U+00ac # '¬'
compose ',' '-' to U+00ac # '¬'
compose 'R' 'O' to U+00ae # '®'
compose 'O' 'R' to U+00ae # '®'
compose 'r' 'o' to U+00ae # '®'
compose 'o' 'r' to U+00ae # '®'
compose 'o' 'o' to U+00b0 # '°'
compose '+' '-' to U+00b1 # '±'
compose '-' '+' to U+00b1 # '±'
compose 'm' 'u' to U+00b5 # 'µ'
compose '/' 'u' to U+00b5 # 'µ'
compose 'u' '/' to U+00b5 # 'µ'
compose 'p' '!' to U+00b6 # '¶'
compose 'P' '!' to U+00b6 # '¶'
compose '.' '-' to U+00b7 # '·'
compose '>' '>' to U+00bb # '»'
compose '?' '?' to U+00bf # '¿'
compose 'x' 'x' to U+00d7 # '×'
compose ':' '-' to U+00f7 # '÷'
compose '-' ':' to U+00f7 # '÷'
compose 'P' 'I' to U+03A0 # 'Π'
compose 'p' 'i' to U+03c0 # 'π'
compose '-' '-' to U+2013 # '–' X: --.
compose '_' '_' to U+2014 # '—' X: ---
compose '|' '|' to U+2016 # '‖'
compose '<' '\'' to U+2018 # '‘'
compose '\'' '<' to U+2018 # '‘'
compose '>' '\'' to U+2019 # '’'
compose '\'' '>' to U+2019 # '’'
compose '<' '"' to U+201c # '“'
compose '"' '<' to U+201c # '“'
compose '>' '"' to U+201d # '”'
compose '"' '>' to U+201d # '”'
compose '/' '-' to U+2020 # '†'
compose '/' '+' to U+2021 # '‡'
compose '.' '=' to U+2022 # '•'
compose '.' '.' to U+2026 # '…'
compose '%' 'o' to U+2030 # '‰'
compose '%' 'O' to U+2030 # '‰'
compose 'T' 'M' to U+2122 # '™'
compose 't' 'm' to U+2122 # '™'
compose '<' '-' to U+2190 # '←'
compose '^' '^' to U+2191 # '↑'
compose '-' '>' to U+2192 # '→'
compose 'v' 'v' to U+2193 # '↓'
compose '=' '_' to U+2261 # '≡'
compose '<' '=' to U+2264 # '≤'
compose '>' '=' to U+2265 # '≥'
compose '1' '2' to U+00bd # '½'
compose '1' '3' to U+2153 # '⅓'
compose '2' '3' to U+2154 # '⅔'
compose '1' '4' to U+00bc # '¼'
compose '3' '4' to U+00be # '¾'
compose '1' '5' to U+2155 # '⅕'
compose '2' '5' to U+2156 # '⅖'
compose '3' '5' to U+2157 # '⅗'
compose '4' '5' to U+2158 # '⅘'
compose '1' '6' to U+2159 # '⅙'
compose '5' '6' to U+215a # '⅚'
compose '1' '8' to U+215b # '⅛'
compose '3' '8' to U+215c # '⅜'
compose '5' '8' to U+215d # '⅝'
compose '7' '8' to U+215e # '⅞'
compose '^' '0' to U+2070 # '⁰'
compose '^' '1' to U+00b9 # '¹'
compose '^' '2' to U+00b2 # '²'
compose '^' '3' to U+00b3 # '³'
compose '^' '4' to U+2074 # '⁴'
compose '^' '5' to U+2075 # '⁵'
compose '^' '6' to U+2076 # '⁶'
compose '^' '7' to U+2077 # '⁷'
compose '^' '8' to U+2078 # '⁸'
compose '^' '9' to U+2079 # '⁹'
compose '#' 'o' to U+00ba # 'º' X also: ^_o
compose '#' 'a' to U+00aa # 'ª' X also: ^_a
compose '#' 'e' to U+266a # '♪'
compose '#' 'E' to U+266b # '♫'
compose '#' 'S' to U+266c # '♬'
compose '#' 'b' to U+266d # '♭'
compose '#' 'f' to U+266e # '♮'
compose '#' '#' to U+266f # '♯'
compose '^' '-' to U+203f # '‿'
compose 's' 'x' to U+2704 # '✄'

#
# $HOME/.XCompose last edited 2019-07-07
# My Compose redefinitions for X, so as to match
# my VC ones in /etc/console-setup/remap.inc

# Pull in the system file first because it's skipped when this file exists
include "%S/en_US.UTF-8/Compose"

<Multi_key> <c> <o>                     : "©"   copyright # COPYRIGHT SIGN
<Multi_key> <r> <o>                     : "®"   registered # REGISTERED SIGN
<Multi_key> <P> <I>                     : "Π"   U03A0 # GREEK CAPITAL LETTER PI
<Multi_key> <p> <i>                     : "π"   U03C0 # GREEK SMALL LETTER PI
<Multi_key> <slash> <minus>             : "†"   dagger # DAGGER
<Multi_key> <slash> <plus>              : "‡"   doubledagger # DOUBLE DAGGER
<Multi_key> <percent> <O>               : "‰"   U2030 # PER MILLE SIGN
<Multi_key> <asciicircum> <asciicircum> : "↑"   uparrow # UPWARDS ARROW
<Multi_key> <v> <v>                     : "↓"   downarrow # DOWNWARDS ARROW
<Multi_key> <bar> <bar>                 : "‖"   U2016 # DOUBLE VERTICAL LINE
<Multi_key> <numbersign> <o>            : "º"   U00ba # MASCULINE ORDINAL INDICATOR
<Multi_key> <numbersign> <a>            : "ª"   U00aa # FEMININE ORDINAL INDICATOR
<Multi_key> <asciicircum> <minus>       : "‿"   U203f # UNDERTIE
<Multi_key> <s> <x>                     : "✄"   U2704 # WHITE SCISSORS

#
; Some odd characters definitions.
(global-set-key [?\C-x ?8 ?* ?\\ up] "↖") ; up \ arrow
(global-set-key [?\C-x ?8 ?* ?\\ down] "↘") ; down \ arrow
(global-set-key [?\C-x ?8 ?* ?/ up] "↗") ; up / arrow
(global-set-key [?\C-x ?8 ?* ?/ right] "⇒") ; hollow right arrow
(global-set-key [?\C-x ?8 ?* ?/ down] "↙") ; down / arrow
(global-set-key [?\C-x ?8 ?* ?/ left] "⇐") ; hollow left arrow
(global-set-key [?\C-x ?8 ?/ ?^] "↕") ; updown arrow
(global-set-key [?\C-x ?8 ?/ ?<] "↔") ; leftright arrow
(global-set-key [?\C-x ?8 ?/ ?>] "↔") ; leftright arrow

Reply to: