diff --git a/.xinitrc b/.xinitrc new file mode 100755 index 0000000..9f80218 --- /dev/null +++ b/.xinitrc @@ -0,0 +1,27 @@ +#!/bin/sh +if [ -x /usr/local/bin/dbus-launch -a -z "${DBUS_SESSION_BUS_ADDRESS}" ]; then + eval `dbus-launch --sh-syntax --exit-with-session` +fi + +xinput set-prop "/dev/wsmouse" "WS Pointer Wheel Emulation" 1 +xinput set-prop "/dev/wsmouse" "WS Pointer Wheel Emulation Axes" 6 7 4 5 +xinput set-prop "/dev/wsmouse" "WS Pointer Wheel Emulation Button" 2 +xinput set-prop "/dev/wsmouse" "WS Pointer Wheel Emulation Timeout" 50 +xinput set-prop "/dev/wsmouse" "WS Pointer Wheel Emulation Inertia" 3 +### xrandr --output eDP-1 --brightness 0.4 --gamma 0.9:0.9:0.7 +### doas wsconsctl -w display.brightness=66 + +export XMODIFIERS=@im=SCIM GTK_IM_MODULE=xim QT_IM_MODULE=xim +export LC_CTYPE=ja_JP.UTF-8 + +xclock -geometry 60x60-0+0 & +scim -d & +kterm -T kterm-2: -geometry 80x38-0-0& +mlterm -T term-u:& +xset dpms 180 190 200 +# setxkbmap -option ctrl:nocaps +M4PATH=$HOME fvwm2 -replace -cmd 'FvwmM4 -D_DOM=gentei.org .fvwm2rc' & +xmodmap $HOME/script/keydef/106.map +syndaemon -i 0.8 -t -k & +xidle -program '/usr/X11R6/bin/xlock -mode random' & +kterm -C -T console: -g 80x30-60+0 diff --git a/etc/X11/xorg.conf.d/10-mouse.conf b/etc/X11/xorg.conf.d/10-mouse.conf new file mode 100644 index 0000000..aaf52c4 --- /dev/null +++ b/etc/X11/xorg.conf.d/10-mouse.conf @@ -0,0 +1,19 @@ +Section "InputClass" + Identifier "touchpad" + Driver "synaptics" + MatchIsTouchpad "on" + ##Option "VertEdgeScroll" "on" + Option "VertTwoFingerScroll" "on" + ##Option "HorizEdgeScroll" "on" + Option "HorizTwoFingerScroll" "on" + Option "CircularScrolling" "on" + #Option "CircScrollTrigger" "2" + Option "CircScrollTrigger" "5" + Option "EmulateTwoFingerMinZ" "40" + Option "EmulateTwoFingerMinW" "8" + Option "MaxTapTime" "125" + Option "VertScrollDelta" "-76" + Option "HorizScrollDelta" "-76" + Option "DialDelta" "-76" + Option "TapButton1" "1" +EndSection diff --git a/etc/apm/hibernate b/etc/apm/hibernate new file mode 120000 index 0000000..3edc27c --- /dev/null +++ b/etc/apm/hibernate @@ -0,0 +1 @@ +suspend \ No newline at end of file diff --git a/etc/apm/resume b/etc/apm/resume new file mode 100755 index 0000000..28e6259 --- /dev/null +++ b/etc/apm/resume @@ -0,0 +1,17 @@ +#!/bin/sh +wifi=${WIFI:-urtwn0} + +(id; pwd) > /tmp/resume.id +upscript=/etc/apm/wifi-reconn.sh + +(trial=3 + while [ $trial -gt 0 ]; do + if $upscript; then + break + else + sleep 3 + trial=$((trial-1)) + fi + done +) +# > /tmp/urt-up.log 2>&1 diff --git a/etc/apm/suspend b/etc/apm/suspend new file mode 100755 index 0000000..67d0389 --- /dev/null +++ b/etc/apm/suspend @@ -0,0 +1,2 @@ +#!/bin/sh +pkill -USR1 xidle diff --git a/etc/apm/wifi-reconn.sh b/etc/apm/wifi-reconn.sh new file mode 100755 index 0000000..eceab67 --- /dev/null +++ b/etc/apm/wifi-reconn.sh @@ -0,0 +1,36 @@ +#!/bin/sh +PATH=/usr/iekei/bin/DT:$PATH +totalrep=3 +retry=10 +mydir=`dirname $0` +static=$mydir/ssid + +if [ -e $static ]; then + ssids=`cat $static` +else + ssids=`egrep -ql '^ *(join|nwid)' /etc/hostname.*|sed 's/.*\.//'` +fi + +complete() { + svc -t /service/openvpn /service/is-monster + exit 0 +} + +for wlif in $ssids +do + echo i=$wlif + sh /etc/netstart $wlif + ifconfig $wlif | grep -q 'status: active' && complete + for ssid in `egrep '^ *(join|nwid)' /etc/hostname.$wlif|awk '{print $2}'` + do + echo Trying.........................$ssid + i=$retry + ifconfig $wlif nwid $ssid + while [ $i -gt 0 ]; do + ifconfig $wlif | grep -q 'status: active' && complete + i=$((i-1)) + sleep 1 + done + done +done +exit 1 diff --git a/etc/hotplug/attach b/etc/hotplug/attach new file mode 100755 index 0000000..f2e5c8d --- /dev/null +++ b/etc/hotplug/attach @@ -0,0 +1,20 @@ +#!/bin/ksh +# +# $Header$ + +DEVCLASS=$1 +DEVNAME=$2 + +# (echo `date`: args="$*" disk=$DEVNAME) >> /tmp/attach.args 2>&1 +[[ $DEVCLASS != 2 ]] && exit 0 + +case $DEVNAME in +sd[123]) + echo Mounting $DEVNAME >> /tmp/attach.args + disklabel $DEVNAME | grep i:.*MSDOS > /dev/null + [[ $? -eq 0 ]] && mount /dev/"$DEVNAME"i + ;; +cd[01234]) + disklabel $DEVNAME | grep -i 'ISO9660' > /dev/null 2>&1 + [[ $? -eq 0 ]] && mount /dev/${DEVNAME}a +esac diff --git a/etc/hotplug/detach b/etc/hotplug/detach new file mode 100755 index 0000000..7b7d7a5 --- /dev/null +++ b/etc/hotplug/detach @@ -0,0 +1,14 @@ +#!/bin/ksh +# +# $Header$ + +DEVCLASS=$1 +DEVNAME=$2 + +[[ $DEVCLASS != 2 ]] && exit 0 +case $DEVNAME in + [cs]d[0-9]) + umount /dev/${DEVNAME}i + exit 0 + ;; +esac diff --git a/etc/rc.local b/etc/rc.local new file mode 100644 index 0000000..f425e97 --- /dev/null +++ b/etc/rc.local @@ -0,0 +1,20 @@ +for trial in 1 2 3 4 5; do + bioctl -c C -l sd0l softraid0 && break + sleep 1 +done +fsck -p /home +mount /home +echo -n ' mounting /home' + +PATH=/usr/koeki/daemontools/bin:$PATH +if [ -x /usr/koeki/daemontools/bin/svscanboot ]; then + echo ' daemontools' + csh -cf '/usr/koeki/daemontools/bin/svscanboot &' +fi + +# Canna server +if [ -x /usr/koeki/Canna/sbin/cannaserver ]; then + /usr/koeki/Canna/sbin/cannaserver; echo -n ' canna' +fi + +echo '.' diff --git a/usr/koeki/etc/battery b/usr/koeki/etc/battery new file mode 100644 index 0000000..af92b34 --- /dev/null +++ b/usr/koeki/etc/battery @@ -0,0 +1,56 @@ +#!/bin/sh + +getval() { + case $1 in + lastfull) fld=acpibat0.watthour0 ;; + remain) fld=acpibat0.watthour3 ;; + rate) fld=acpibat0.power0 ;; + power) fld=acpiac0.indicator0 ;; + esac + sysctl -n hw.sensors.$fld | cut -d' ' -f1 +} +for v in remain lastfull rate power; do + eval $v=`getval $v` +done +# echo $remain $lastfull $rate $power +percent=`echo "100*$remain/$lastfull"|bc -l|cut -d. -f1` +case $rate in + 0.0*) rate=0 ;; +esac +case $power in + Off) + printf "AC Offline: Battery remaining %5.1f%%\n" $percent + if [ x"$rate" = x"0" ]; then + echo Unknown lifetime + else + life=`echo "$remain/$rate"|bc -l` + hour=${life%.*} dmin=${life#*.} + min=`echo "0.$dmin * 60" | bc -l | cut -d. -f1` + printf "Discharging at %.2f(%.2f/%.2f) - ${hour:-0}h%02dm to go\n" $rate $remain $lastfull $min + fi + ;; + On) + printf "AC ONline: Battery remaining %5.1f%%\n" $percent + if [ x"$rate" = x"0" ]; then + echo "Last full capacity: ${lastfull}Wh" + else + tf=`echo "$lastfull - $remain"|bc -l` + tofull=`echo "$tf/$rate"|bc -l` + hour=${tofull%.*} dmin=${tofull#*.} + min=`echo "0.$dmin * 60" | bc -l | cut -d. -f1` + printf "Rate $rate to $tf ($remain/$lastfull) - " + printf "${hour:-0}h%02dm to full\n" $min + fi + ;; +esac + +# hw.sensors.acpibat0.volt0=11.40 VDC (voltage) +# hw.sensors.acpibat0.volt1=11.75 VDC (current voltage) +# hw.sensors.acpibat0.power0=6.59 W (rate) +# hw.sensors.acpibat0.watthour0=46.74 Wh (last full capacity) +# hw.sensors.acpibat0.watthour1=2.34 Wh (warning capacity) +# hw.sensors.acpibat0.watthour2=0.20 Wh (low capacity) +# hw.sensors.acpibat0.watthour3=30.78 Wh (remaining capacity), OK +# hw.sensors.acpibat0.watthour4=48.10 Wh (design capacity) +# hw.sensors.acpibat0.raw0=1 (battery discharging), OK +# hw.sensors.acpibat0.raw1=24 (discharge cycles)