Created
December 19, 2012 23:01
-
-
Save Dieterbe/4341413 to your computer and use it in GitHub Desktop.
auto advance html slides using xdotool
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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