diff .bash_profile @ 105:3f1ead4ba8b4

Changes for the Pi: * Code block to start emulationstation if the circumstances warrant, as well * as checking for the presence of a PS3 controller and warning that it isn't * connected. Also adding usernames to the ssh config to make aliases and * whatnot work more easily.
author Steve Huston <huston@astro.princeton.edu>
date Sat, 08 Mar 2014 10:00:34 -0500
parents c4dccb49471b
children 90f60047d5b4
line wrap: on
line diff
--- a/.bash_profile	Wed Dec 18 17:11:07 2013 -0500
+++ b/.bash_profile	Sat Mar 08 10:00:34 2014 -0500
@@ -66,3 +66,23 @@
   echo Local repository contains updates. 
 fi
 hg status
+
+[[ $HOST == cake && "`tty`" == "/dev/tty1" ]] && {
+  # We're on the Raspberry Pi
+  export SDL_NOMOUSE=1
+  if [ ! -e /dev/input/js0 ] ; then
+    # PS3 controller isn't paired yet
+    dialog --infobox "WARNING: PS3 controller not detected.  Please press the PS button to pair.  Ctrl-C on keyboard to skip." 4 55
+    (
+      trap break INT
+      for C in {1..30} ; do
+        sleep 1
+          if [ -e /dev/input/js0 ] ; then
+            break
+          fi
+      done
+    )
+  fi
+  clear
+  /usr/bin/emulationstation
+}