Skip to content

Instantly share code, notes, and snippets.

@revolunet
Last active August 29, 2015 14:07
Show Gist options
  • Save revolunet/68fcf726167dfd90c91f to your computer and use it in GitHub Desktop.
Save revolunet/68fcf726167dfd90c91f to your computer and use it in GitHub Desktop.
some raspberrypi tricks

launch omxplayer at startup and loop

add this to /etc/rc.local

clear
omxplayer /path/to/video.avi --loop --video_fifo 1 --video_queue 1 --no-osd --no-keys > /dev/null

launch a script at startup in a screen

create a start.sh script to initialize your screen

cd /path/to/app

# if you need to activate a python virtualenv
source /path/to/.virtualenvs/project/bin/activate

# create the screen "srv" with an empty tab
screen -AdmS srv -t home
# add a first script in a "health" tab
screen -S srv -X screen -t health node /path/to/health.js
# run another one in another tab
screen -S srv -X screen -t server python server.py

customize your ~/.screenrc to display the tabs

altscreen on
term screen-256color
#
#change the hardstatus settings to give an window list at the bottom of the
#screen, with the time and date and with the current window highlighted
hardstatus alwayslastline
#hardstatus string '%{= kG}%-Lw%{= kW}%50> %n%f* %t%{= kG}%+Lw%< %{= kG}%-=%c:%s%{-}'
hardstatus string '%{= kG}[ %{G}%H %{g}][%= %{= kw}%?%-Lw%?%{r}(%{W}%n*%f%t%?(%u)%?%{r})%{w}%?%+Lw%?%?%= %{g}][%{B} %m-%d %{W}%c %{g}]'

launch it at boot with /etc/rc.local

su - juju -c "/path/to/start.sh"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment