aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.com>2008-04-03 01:41:58 +0000
committerOlivier Blin <oblin@mandriva.com>2008-04-03 01:41:58 +0000
commit2df23eafb9b0d76051830824e8fa55565e5827ce (patch)
tree97f34eb48477fd7b0209c492a39c56f483bffb76
parent1810e56d78c4d1ed0bc8a4d77837d67467dfd56e (diff)
downloadnumlock-2df23eafb9b0d76051830824e8fa55565e5827ce.tar
numlock-2df23eafb9b0d76051830824e8fa55565e5827ce.tar.gz
numlock-2df23eafb9b0d76051830824e8fa55565e5827ce.tar.bz2
numlock-2df23eafb9b0d76051830824e8fa55565e5827ce.tar.xz
numlock-2df23eafb9b0d76051830824e8fa55565e5827ce.zip
do not change numlock status on remote displays (from Frank Griffin, #15299)
-rwxr-xr-xnumlock.xinit19
1 files changed, 17 insertions, 2 deletions
diff --git a/numlock.xinit b/numlock.xinit
index 0cf1ed4..3dba770 100755
--- a/numlock.xinit
+++ b/numlock.xinit
@@ -8,8 +8,23 @@
# Created On : Wed Apr 12 08:39:24 2000
#---------------------------------------------------------------
-if [ -f /var/lock/subsys/numlock -a -x /usr/bin/enable_X11_numlock ]; then
- /usr/bin/enable_X11_numlock
+#
+# The following code used to execute enable_numlock if numlock was enabled
+# on this host. This screwed hosts which did not use numlock (laptops)
+# but which tried to create XDMCP sessions to this host, as numlock would
+# be turned on unconditionally.
+#
+# The following code detects a $DISPLAY host other than what would be
+# expected for a local X session on this host, and exempts it from the
+# automatic execution of numlock.
+#
+DISPHOST=${DISPLAY%%:*}
+if [ "$DISPHOST" = "" -o "$DISPHOST" = "localhost" -o "$DISPHOST" = "$HOSTNAME" ]
+ then
+ if [ -f /var/lock/subsys/numlock -a -x /usr/bin/enable_X11_numlock ]; then
+ /usr/bin/enable_X11_numlock
+ fi
+ else
fi
# numlock ends here