Make xinitrc-common survive set -u
What is set -u? set -u makes expanding an undefined variable an error, which (here) would happen when XKB_IN_USE != yes. This seems like a strange thing to want, and a rather stern thing to impose upon the shell scripts of others, but whatever let's just write the test a different way. Signed-off-by: Adam Jackson <ajax@redhat.com>
This commit is contained in:
parent
42375103e3
commit
a3ff64b26f
@ -34,22 +34,18 @@ sysxkbmap=/etc/X11/Xkbmap
|
|||||||
# merge in keymaps
|
# merge in keymaps
|
||||||
if [ -r "$sysxkbmap" ]; then
|
if [ -r "$sysxkbmap" ]; then
|
||||||
setxkbmap $(cat "$sysxkbmap")
|
setxkbmap $(cat "$sysxkbmap")
|
||||||
XKB_IN_USE=yes
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -r "$userxkbmap" ]; then
|
if [ -r "$userxkbmap" ]; then
|
||||||
setxkbmap $(cat "$userxkbmap")
|
setxkbmap $(cat "$userxkbmap")
|
||||||
XKB_IN_USE=yes
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# xkb and xmodmap don't play nice together
|
# xkb and xmodmap don't play nice together
|
||||||
if [ -z "$XKB_IN_USE" ]; then
|
if ! [ -r "$sysxkbmap" -o -r "$userxkbmap" ] ; then
|
||||||
[ -r "$sysmodmap" ] && xmodmap "$sysmodmap"
|
[ -r "$sysmodmap" ] && xmodmap "$sysmodmap"
|
||||||
[ -r "$usermodmap" ] && xmodmap "$usermodmap"
|
[ -r "$usermodmap" ] && xmodmap "$usermodmap"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
unset XKB_IN_USE
|
|
||||||
|
|
||||||
# run all system xinitrc shell scripts.
|
# run all system xinitrc shell scripts.
|
||||||
for file in /etc/X11/xinit/xinitrc.d/* ; do
|
for file in /etc/X11/xinit/xinitrc.d/* ; do
|
||||||
. $file
|
. $file
|
||||||
|
Loading…
Reference in New Issue
Block a user