aboutsummaryrefslogtreecommitdiff
path: root/script.h
blob: fac0f7228caf1f23bc93dd452c2eff721fd42726 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
static char *copyurl[] = { "/bin/sh", "-c",
	"echo 'X' | grep -Pq 'X' && grepflags='-Po' || grepflags='-Eo';"
	"urlregex='(((http|https|ftp|gopher)|mailto)[.:][^ >\"\\t]*|www\\.[-a-z0-9.]+)[^ .,;\\t>\">\\):]';"
	"urls=\"$(sed 's/.*│//g' | tr -d '\n' | grep $grepflags \"$urlregex\" | sed \"s/'$//g\")\";"

	"[ -z \"$urls\" ] && exit;"
	"echo \"$urls\" | awk '!seen[$0]++' | dmenu -l 10 | xclip -sel clipboard",
	"externalpipe", NULL };

/* vim: ft=c
 */