github
Advanced Search
  • Home
  • Pricing and Signup
  • Explore GitHub
  • Blog
  • Login

singpolyma / singpolyma

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
  • Pull Request
  • Download Source
    • 1
    • 0
  • Source
  • Commits
  • Network (0)
  • Issues (0)
  • Downloads (0)
  • Wiki (1)
  • Graphs
  • Branch: master

click here to add a description

click here to add a homepage

  • Branches (1)
    • master ✓
  • Tags (0)
Sending Request…
Enable Donations

Pledgie Donations

Once activated, we'll place the following badge in your repository's detail box:
Pledgie_example
This service is courtesy of Pledgie.

This repository is just miscellaneous stuff. It is from my old devjavu SVN repo. Some of this stuff should get it's own repo. — Read more

  cancel

http://singpolyma.net/

  cancel
  • Private
  • Read-Only
  • HTTP Read-Only

This URL has Read+Write access

Added subdirs script 
singpolyma (author)
Thu Nov 05 12:28:49 -0800 2009
commit  ec5b26353ce175a9372630ba6fb07ccdd77a0151
tree    58b05a91c8e97654cb35d48303d1ede5c2dd6977
parent  e440f79f304bb6123c7588fb85ec79bb83414e0e
singpolyma / uzbl / data / scripts / userscript.sh uzbl/data/scripts/userscript.sh
100755 42 lines (38 sloc) 1.221 kb
edit raw blame history
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/bin/sh
 
url="$6"
fifo="$4"
 
do_scripts() {
scripts_dir="$1"
IFS="
"
# Loop over all userscripts in the directory
for SCRIPT in `grep -lx "\s*//\s*==UserScript==\s*" "$scripts_dir"/*`; do
# Extract metadata chunk
META="`sed -ne '/^\s*\/\/\s*==UserScript==\s*$/,/^\s*\/\/\s*==\/UserScript==\s*$/p' "$SCRIPT"`"
SHOULD_RUN=false # Assume this script will not be included
# Loop over all include rules
for INCLUDE in `echo "$META" | grep "^\s*\/\/\s*@include"`; do
# Munge into grep pattern
INCLUDE="`echo "$INCLUDE" | sed -e 's/^\s*\/\/\s*@include\s*//' -e 's/\./\\\\./g' -e 's/\*/.*/g' -e 's/[\r\n]//g'`"
if echo "$url" | grep -x "$INCLUDE"; then
SHOULD_RUN=true
break
fi
done
# Loop over all exclude rules
for EXCLUDE in `echo "$META" | grep "^\s*\/\/\s*@exclude"`; do
# Munge into grep pattern
EXCLUDE="`echo "$EXCLUDE" | sed -e 's/^\s*\/\/\s*@exclude\s*//' -e 's/\./\\\\./g' -e 's/\*/.*/g' -e 's/[\r\n]//g'`"
if echo "$url" | grep -x "$EXCLUDE"; then
SHOULD_RUN=false
break
fi
done
# Run the script
if [ $SHOULD_RUN = true ]; then
echo "script '$SCRIPT'" > "$fifo"
fi
done
}
 
# TODO search XDG_DATA_DIRS
do_scripts "`dirname $0`/../userscripts"
 
Blog | Support | Training | Contact | API | Status | Twitter | Help | Security
© 2010 GitHub Inc. All rights reserved. | Terms of Service | Privacy Policy
Powered by the Dedicated Servers and
Cloud Computing of Rackspace Hosting®
Dedicated Server