aboutsummaryrefslogtreecommitdiffstats
path: root/numlock.xinit
blob: 3dba770ba00da06795866c56f88912a9269afd6e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/sh
#---------------------------------------------------------------
# Project         : Mandrake
# Module          : numlock
# File            : numlock.xinit
# Version         : $Id$
# Author          : Frederic Lepied
# Created On      : Wed Apr 12 08:39:24 2000
#---------------------------------------------------------------

#
#  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