index.md - sites - public wiki contents of suckless.org | |
git clone git://git.suckless.org/sites | |
Log | |
Files | |
Refs | |
--- | |
index.md (472B) | |
--- | |
1 autorefresh | |
2 =========== | |
3 | |
4 Simple script to auto refresh surf pages. | |
5 Launch the script again to stop auto reloading (easy to use with dmenu) | |
6 | |
7 #!/bin/sh | |
8 # Simple script to refresh surf page | |
9 # [email protected] | |
10 | |
11 REFRESH=3 | |
12 LOCKFILE=/tmp/surfrefresh.lock | |
13 | |
14 | |
15 if [ -e $LOCKFILE ]; then | |
16 echo "stop refreshing surf" | |
17 PID=$(cat $LOCKFILE) | |
18 rm $LOCKFILE | |
19 kill -KILL $PID | |
20 else | |
21 echo $$ > $LOCKFILE | |
22 while true; do | |
23 kill -HUP $1 | |
24 sleep $REFRESH | |
25 done | |
26 fi | |
27 exit 0 |