#!/bin/bash
#
# Startup file for Fvwm
#

echo "0" >/proc/power_key_off 2>/dev/null

test -f /etc/profile && . /etc/profile

if [ ! -d $HOME/Choices/common ]; then
    mkdir -p $HOME/Choices/common
fi

if [ -f $HOME/Choices/lightnpower.cfg ]; then
    lightnpower.py --loadandquit
fi

MODEL=`cat /proc/deviceinfo/product`
case "$MODEL" in
    SL-6000)
	test -f /etc/X11/kb/tosa.xmodmap && xmodmap /etc/X11/kb/tosa.xmodmap
	;;
    SL-C860|SL-C760|SL-C750|SL-7500|SL-C700) 
	test -f /etc/X11/kb/corgi.xmodmap && xmodmap /etc/X11/kb/corgi.xmodmap
	;;
    SL-C1000|SL-C3000|SL-C3100)
	test -f /etc/X11/kb/akita.xmodmap && xmodmap /etc/X11/kb/akita.xmodmap
	;;
    *)
	cat /proc/cpuinfo | grep 'Sharp-Collie' 2>/dev/null >/dev/null && test -f /etc/X11/kb/collie.xmodmap && xmodmap /etc/X11/kb/collie.xmodmap
	;;
esac

xmodmap /usr/share/fvwm-pdaxrom/fvwm.xmodmap

test -f $HOME/.fvwm/closed && rm $HOME/.fvwm/closed
fvwm-welcome.sh &

#/usr/bin/fvwm
fvwm

echo "1" >/proc/power_key_off 2>/dev/null
