[hackers] [surf] Use the surf user agent when downloading with wget. || Troels Henriksen
changeset: 229:db176922bb09
tag: tip
user: Troels Henriksen <athas_AT_sigkill.dk>
date: Sat Nov 05 11:43:46 2011 +0100
files: config.def.h surf.c
description:
Use the surf user agent when downloading with wget.
diff -r a2eb61c06f1d -r db176922bb09 config.def.h
--- a/config.def.h Fri Nov 04 13:57:04 2011 +0100
+++ b/config.def.h Sat Nov 05 11:43:46 2011 +0100
_AT_@ -15,10 +15,11 @@
"prop=\"`xprop -id $2 $0 | cut -d '\"' -f 2 | dmenu`\" &&" \
"xprop -id $2 -f $1 8s -set $1 \"$prop\"", \
p, q, winid, NULL } }
-#define DOWNLOAD(d) { \
+#define DOWNLOAD(d, u) { \
.v = (char *[]){ "/bin/sh", "-c", \
- "xterm -e \"wget --load-cookies ~/.surf/cookies.txt '$0';\"", \
- d, NULL } }
+ "xterm -e \"wget '$0' \
+--load-cookies ~/.surf/cookies.txt \
+--user-agent '$1' ; sleep 5\"", d, u, NULL } }
#define MODKEY GDK_CONTROL_MASK
static Key keys[] = {
/* modifier keyval function arg Focus */
diff -r a2eb61c06f1d -r db176922bb09 surf.c
--- a/surf.c Fri Nov 04 13:57:04 2011 +0100
+++ b/surf.c Sat Nov 05 11:43:46 2011 +0100
_AT_@ -345,7 +345,7 @@
Arg arg;
updatewinid(c);
- arg = (Arg)DOWNLOAD((char *)webkit_download_get_uri(o));
+ arg = (Arg)DOWNLOAD((char *)webkit_download_get_uri(o), useragent);
spawn(c, &arg);
return FALSE;
}
Received on Sat Nov 05 2011 - 11:44:34 CET
This archive was generated by hypermail 2.3.0
: Sat Nov 05 2011 - 11:48:05 CET