File: 55numlockx

package info (click to toggle)
numlockx 1.2-4
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 480 kB
  • sloc: sh: 905; ansic: 677; makefile: 119
file content (33 lines) | stat: -rw-r--r-- 672 bytes parent folder | download
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
31
32
33
# X session startup script: /etc/X11/Xsession.d/55numlockx

# Initial settings
NUMLOCK=auto

# Load configuration
if [ -f /etc/default/numlockx ] ; then
    . /etc/default/numlockx
fi

# Toggle numlock if we're not removed
if [ -x /usr/bin/numlockx ] ; then
    case $NUMLOCK in
        off|on)
            SET=1
            ;;
        keep)
            SET=0
            ;;
        *)
            SET=1
            NUMLOCK=on
            if [ -x /usr/sbin/laptop-detect ]; then
                if /usr/sbin/laptop-detect; then
                    NUMLOCK=off
                fi
            fi
            ;;
    esac
    /usr/bin/numlockx $NUMLOCK || /bin/true
fi

# EOF