Skip to content

Instantly share code, notes, and snippets.

@Dieterbe
Created December 19, 2012 23:01
Show Gist options
  • Save Dieterbe/4341413 to your computer and use it in GitHub Desktop.
Save Dieterbe/4341413 to your computer and use it in GitHub Desktop.
auto advance html slides using xdotool
#!/bin/bash
# dependencies: xdotool
# auto-advance html slides
# <[email protected]>
html_file="$1"
BROWSER=chromium
slide=1
right () {
slide=$((slide+1))
log "going right to slide $slide"
xdotool key --clearmodifiers Right
}
left () {
slide=$((slide-1))
log "going left to slide $slide"
xdotool key --clearmodifiers Left
}
log () {
echo "$(date) $@"
}
$BROWSER "$html_file"
log "please switch to browser... waiting 5 seconds"
sleep 5
log "testing..."
right
sleep 0.2
left
log "GO"
for slide in {1..20}; do
sleep 15
[ $slide -lt 20 ] && right
done
log "all done!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment