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
21 elif [ -f /tmp/.tpope_lights ]; then
23 rm -f /tmp/.tpope_lights
27 if [ "$activity" ]; then
28 information="$activity"
29 elif [ "$away" ]; then
31 elif [ "$old_alive" = "lisa" ]; then
32 information="On laptop"
37 if [ -z "$information" ]; then
38 echo > "$HOME/.caminfo"
39 echo Here > "$HOME/.status"
42 echo "- $information" > "$HOME/.caminfo"
43 echo "$information" > "$HOME/.status"
44 echo "$information" > "$HOME/.plan"
47 ping -c 1 bart >/dev/null && scp -q "$HOME/.status" bart: 2>/dev/null
48 ping -c 1 abe >/dev/null && scp -q "$HOME/.status" abe: 2>/dev/null