# 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
