Skip to content

Instantly share code, notes, and snippets.

@simonhaenisch
Last active February 15, 2018 00:49
Show Gist options
  • Save simonhaenisch/58b6f95ff5842c541e672feed5e54b93 to your computer and use it in GitHub Desktop.
Save simonhaenisch/58b6f95ff5842c541e672feed5e54b93 to your computer and use it in GitHub Desktop.
sync slideshows from Google team drive using rclone on ARM #raspberrypi
# see https://gist.github.com/simonhaenisch/0ca8534bf50f189b4f93d1cc1f20c58f
su # run as root
pacman -Sy # update repos
pacman -S git go # install git and go compiler
go get -u -v github.com/ncw/rclone # installs into ~/go/bin/rclone
mkdir /var/gdrive/slides
rclone config
# n: new remote
# name: gdrive
# storage: drive
# client_id: <empty>
# client_secret: <empty>
# [scope: drive]
# [root_folder_id: <empty>]
# [service_account_file: <empty>]
# auto config: no
# open browser => select account => copy & paste verification code
# team drive: yes
# enter desired team drive id
# y: yes this is ok
# q: quit config
#!/bin/bash
basedir="/var/gdrive/slides"
killall fbi &> /dev/null
# get subdir from command line argument if given
if [ $# -eq 0 ]; then
subdir="default"
else
subdir=$1
fi
# combine to slide directory
slidedir="$basedir/$subdir"
# check if dir exists
if [ ! -d "$slidedir" ]; then
echo "Error: could not find $slidedir"
# fall back to default dir
slidedir="$basedir/default"
fi
# run framebuffer image viewer on console 1 (-T 1)
fbi -noverbose -T 1 -a -t 7 -u `find $slidedir -iname "*.jpg"`
#!/bin/bash
dir=/var/gdrive/slides
# sync from google team drive
/root/go/bin/rclone sync gdrive:path/to/slides "$dir"
# update crontab
crontab "$dir/cronjobs.txt"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment