[wiki] [sites] Auto refresh surf pages via simple script || Thuban

From: <git_AT_suckless.org>
Date: Sat, 18 May 2013 21:30:34 +0200

commit 00b97dea166b12b86e5b303dfda004125cbac924
Author: Thuban <thuban_AT_singularity.fr>
Date: Sat May 18 21:30:30 2013 +0200

    Auto refresh surf pages via simple script

diff --git a/surf.suckless.org/files/autorefresh.md b/surf.suckless.org/files/autorefresh.md
new file mode 100644
index 0000000..da61799
--- /dev/null
+++ b/surf.suckless.org/files/autorefresh.md
_AT_@ -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_AT_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 %_AT_ ctrl+r
+ sleep $REFRESH
+ done
+ fi
+ exit 0
Received on Sat May 18 2013 - 21:30:34 CEST

This archive was generated by hypermail 2.3.0 : Sat May 18 2013 - 21:36:14 CEST