commit 00b97dea166b12b86e5b303dfda004125cbac924 parent 53d4cfb3b88597972c3aa35274ef0315bc8d1ec6 Author: Thuban <thuban@singularity.fr> Date: Sat, 18 May 2013 21:30:30 +0200 Auto refresh surf pages via simple script Diffstat:
A | surf.suckless.org/files/autorefresh.md | | | 30 | ++++++++++++++++++++++++++++++ |
1 file changed, 30 insertions(+), 0 deletions(-)
diff --git a/surf.suckless.org/files/autorefresh.md b/surf.suckless.org/files/autorefresh.md @@ -0,0 +1,30 @@ +autorefresh +========= + +Simple script to auto refresh surf pages. +Launch the script again to stop auto reloading (easy to use with dmenu) + +Requires xdotools. + + #!/bin/sh + # Simple script to refresh surf page + # requires xdotool + # thuban@singularity.fr + + REFRESH=3 + LOCKFILE=/tmp/surfrefresh.lock + + + if [ -e $LOCKFILE ]; then + echo "stop refreshing surf" + PID=$(cat $LOCKFILE) + rm $LOCKFILE + kill -KILL $PID + else + echo $$ > $LOCKFILE + while true; do + xdotool search --class surf key --window %@ ctrl+r + sleep $REFRESH + done + fi + exit 0