Skip to content

Instantly share code, notes, and snippets.

@mrdaemon
Created October 5, 2011 18:02
Show Gist options
  • Save mrdaemon/1265178 to your computer and use it in GitHub Desktop.
Save mrdaemon/1265178 to your computer and use it in GitHub Desktop.
#!/bin/bash
# .xinitrc for asus eee 701 surf
# Alexandre Gauthier <[email protected]>
# 2011-2012
xset -b # Disable bell
eval $(/usr/bin/ssh-agent)
ASKPASSPROG=/usr/lib/openssh/qt4-ssh-askpass
if [[ -x $ASKPASSPROG ]] ; then
SSH_ASKPASS=$ASKPASSPROG
fi
xrdb -merge $HOME/.Xdefaults
xmodmap $HOME/.Xmodmap
setxkbmap -layout cf
# Fill X server root with black
xsetroot -bg black
# Set wallpaper with feh, failsafe to black fill
FEH=`which feh`
if [[ -x $FEH ]] ; then
$FEH --bg-scale $HOME/Images/bg.jpg
fi
# launch urxvt daemon, further instances will be clients.
# I like how I can be fully happy while using 35mb
[[ -x $(which urxvtd) ]] && urxvtd -q -f -o
# Rather crappy and hacky status bar
while true ; do
if acpi -a | grep off-line > /dev/null; then
xsetroot -name "bat: $( acpi -b | awk '{ print $4 }' | tr -d ',' ) | vol: $(amixer get Master | tail -1 | awk '{ print $5}' | tr -d '[]') | $(date +"%a, %b %d %R")"
else
xsetroot -name "vol: $(amixer get Master | tail -1 | awk '{ print $5}' | tr -d '[]') | $(date +"%a, %b %d %R")"
fi
# NOTE: You may tweak this value to get faster refresh.
# I was mostly concerned about performance seeing how I'm doing
# an awful lot of awk bullshit above.
sleep 5s
done &
# Launch dwm
# TODO: perhaps make this more portable one day, right now it is fairly
# specific to my asus eee 701 Surf.
exec /usr/bin/dwm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment