- Fix computing of the host-system type.
- Fix options handling (thanks for the help to Mike Frysinger).
- Fix DESTDIR handling.
+o Programs:
+ - unicode_{start,stop}: To run loadkeys is allowed only to root.
o Keymaps:
- Add Norwegian dvorak keymap.
- Add turkish F (trf) keyboard map.
# produce UTF-8 encoded multibyte sequences, instead of single bytes
# >= 0x80 in a legacy 8-bit encoding.
-# There is no way of reverting the effect of "dumpkeys | loadkeys --unicode",
-# the memory of the earlier keymap is lost. Therefore, try
-# to save a copy of the original keymap to be able to reload it in unicode_stop.
-# (see also http://mail.nl.linux.org/linux-utf8/2003-08/msg00053.html):
-
-[ -n "$HOME" -a "$HOME" != '/' ] ||
- HOME='/root'
-
-if [ -d "$HOME" ]; then
- [ -d "$HOME/.kbd" ] ||
- mkdir -- "$HOME/.kbd"
- dumpkeys > "$HOME/.kbd/.keymap_sv"
-fi
+# Non-root users are allowed to change the unicode mode of their console, but
+# not the global keymap. root will have to load the keymap in unicode mode
+# explicitly.
+
+uid="`id -u 2>/dev/null`" ||:
+if [ "$uid" = '0' ]; then
+ # There is no way of reverting the effect of "dumpkeys | loadkeys --unicode",
+ # the memory of the earlier keymap is lost. Therefore, try
+ # to save a copy of the original keymap to be able to reload it in unicode_stop.
+ # (see also http://mail.nl.linux.org/linux-utf8/2003-08/msg00053.html):
+
+ [ -n "$HOME" -a "$HOME" != '/' ] ||
+ HOME='/root'
-# redirect stderr and stdout of loadkeys to /dev/null to avoid the confusing
-# "plus before udiaeresis ignored" warnings.
+ if [ -d "$HOME" -a -w "$HOME" ]; then
+ [ -d "$HOME/.kbd" ] ||
+ mkdir -- "$HOME/.kbd"
-dumpkeys | loadkeys --unicode > /dev/null 2>&1
+ [ ! -w "$HOME/.kbd" ] ||
+ dumpkeys > "$HOME/.kbd/.keymap_sv"
+ fi
+
+ # redirect stderr and stdout of loadkeys to /dev/null to avoid the confusing
+ # "plus before udiaeresis ignored" warnings.
+
+ dumpkeys | loadkeys --unicode > /dev/null 2>&1
+fi
# 2. The output side: the console screen.
fi
stty -iutf8
-# "dumpkeys | loadkeys --unicode" which is called in "unicode_start"
-# cannot be reverted, therefore we have to load the keyboard mapping again
-# if it could be sucessfully saved in "unicode_start":
-
-[ ! -r "$HOME/.kbd/.keymap_sv" ] ||
- loadkeys "$HOME/.kbd/.keymap_sv"
+uid="`id -u 2>/dev/null`" ||:
+if [ "$uid" = '0' ]; then
+ [ ! -r "$HOME/.kbd/.keymap_sv" ] ||
+ loadkeys "$HOME/.kbd/.keymap_sv"
+fi