3 # -*- sh -*- vim: ft=sh sw=4 sts=4
5 # Performs routine actions based on my away status. Designed to be
6 # periodically called by cron on homer.
9 activity="`tpope activity`"
10 ping -c 1 marge >/dev/null 2>&1 && eval `ssh marge cat .away-smart`
13 Sleeping|"Away from keyboard"|"Adult Swim"|"") is_away=0 ;;
14 *[Cc]lass*) is_away=1 ;;
17 [ "$old_phone" = absent ] && is_away=1
19 if [ "$is_away" = 1 ]; then
20 [ ! -f /tmp/.tpope_lights ] && touch /tmp/.tpope_lights && br -F -F
22 rm -f /tmp/.tpope_lights; br -n 5
25 if [ "$activity" ]; then
26 information="$activity"
27 elif [ "$away" ]; then
29 elif [ "$old_alive" = "lisa" ]; then
30 information="On laptop"
35 if [ -z "$information" ]; then
36 echo > "$HOME/.caminfo"
37 echo Here > "$HOME/.status"
40 echo " - $information" > "$HOME/.caminfo"
41 echo "$information" > "$HOME/.status"
42 echo "$information" > "$HOME/.plan"
45 ping -c 1 bart >/dev/null && scp -q "$HOME/.status" bart: 2>/dev/null