summaryrefslogtreecommitdiffstats
path: root/core/modules/brazilian/data/opt/openslx/scripts/systemd-load_brazilian_keymaps
blob: 190104b93d6727e1d017e443f6a2b62862e7a2a5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/ash
# Script serves as container script for a systemd-call due to the buggyness of several
# loadkeys-implementations <= kbd (Linux keyboard tools) 1.15.3.
# This bug can be detected through failure of the command pipe 'dumpkeys|loadkeys' yielding
# the message "unknown keysym 'compose'.

# So we first try to insert a keymap including compose-lines:
loadkeys /opt/openslx/keymaps/brazilian_qwerty_compose_keyboard_translation.map
ERR=$?

# ... if this fails we enter a keymap without compose-lines:
if [ "$ERR" -eq 0 ]; then
	exit 0			# in that case everything went smooth - exit.
fi

loadkeys /opt/openslx/keymaps/brazilian_qwerty_keyboard_translation.map		# insert a keymap without compose lines
ERR=$?

# if at this point the second keymap insertion failed we pass the errorlevel to
# systemd - we cannot do more at this point.
exit $ERR