sites

public wiki contents of suckless.org
git clone git://git.suckless.org/sites
Log | Files | Refs

xinitrc.example (1330B)


      1 #!/bin/bash
      2 # Taken from:
      3 #	https://raw.github.com/kaihendry/Kai-s--HOME/master/.xinitrc
      4 #
      5 # for terminus font in Archlinux :(
      6 xset +fp /usr/share/fonts/local
      7 xset fp rehash
      8 
      9 xset -b # disable bell
     10 eval `/usr/bin/ssh-agent`
     11 
     12 if test -f /usr/lib/openssh/x11-ssh-askpass # Archlinux
     13 then
     14 	SSH_ASKPASS=/usr/lib/openssh/x11-ssh-askpass ssh-add < /dev/null
     15 fi
     16 
     17 if test -f /usr/lib/ssh/x11-ssh-askpass # Debian
     18 then
     19 	SSH_ASKPASS=/usr/lib/ssh/x11-ssh-askpass ssh-add < /dev/null
     20 fi
     21 
     22 # 1280x720 = 720p X220
     23 hash fswebcam && fswebcam -q --no-banner -r 1280x720 ~/private/login-photos/$(date +%Y-%m-%dT%H).jpg &
     24 
     25 xrdb -merge $HOME/.Xresources
     26 xmodmap ~/.Xmodmap
     27 setxkbmap -layout gb -option ctrl:nocaps
     28 
     29 hash chromium && chromium &
     30 
     31 while true
     32 do
     33 	VOL=$(amixer get Master | tail -1 | sed 's/.*\[\([0-9]*%\)\].*/\1/')
     34 	LOCALTIME=$(date +%Z\=%Y-%m-%dT%H:%M)
     35 	OTHERTIME=$(TZ=Europe/London date +%Z\=%H:%M)
     36 	IP=$(for i in `ip r`; do echo $i; done | grep -A 1 src | tail -n1) # can get confused if you use vmware
     37 	TEMP="$(($(cat /sys/class/thermal/thermal_zone0/temp) / 1000))C"
     38 
     39 	if acpi -a | grep off-line > /dev/null
     40 	then
     41 		BAT="Bat. $(acpi -b | awk '{ print $4 " " $5 }' | tr -d ',')"
     42 		xsetroot -name "$IP $BAT $VOL $TEMP $LOCALTIME $OTHERTIME"
     43 	else
     44 		xsetroot -name "$IP $VOL $TEMP $LOCALTIME $OTHERTIME"
     45 	fi
     46 	sleep 20s
     47 done &
     48 
     49 exec dwm