Added KERNVER, ACH, and COMMIT variables to user agent.
authorBarrucadu <mike@barrucadu.co.uk>
Mon, 4 May 2009 08:38:20 +0000 (09:38 +0100)
committerBarrucadu <mike@barrucadu.co.uk>
Mon, 4 May 2009 08:38:20 +0000 (09:38 +0100)
Makefile
uzbl.c

index 52d96b6..906436f 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,4 @@
-CPPFLAGS=$(shell pkg-config --cflags gtk+-2.0 webkit-1.0) -Wall -W
+CPPFLAGS=$(shell pkg-config --cflags gtk+-2.0 webkit-1.0) -Wall -W -DKERNVER="\"$(shell uname -r)\"" -DARCH="\"$(shell uname -m)\"" -DCOMMIT="\"$(shell git log | head -n1 | sed "s/.* //")\""
 LDFLAGS=$(shell pkg-config --libs gtk+-2.0 webkit-1.0)
 all: uzbl uzblctrl
 
diff --git a/uzbl.c b/uzbl.c
index 3037484..ae7c755 100644 (file)
--- a/uzbl.c
+++ b/uzbl.c
@@ -971,6 +971,9 @@ settings_init () {
         strcpy(newagent, str_replace("%webkit-major%", itos(WEBKIT_MAJOR_VERSION), useragent));
         strcpy(newagent, str_replace("%webkit-minor%", itos(WEBKIT_MINOR_VERSION), newagent));
         strcpy(newagent, str_replace("%webkit-micro%", itos(WEBKIT_MICRO_VERSION), newagent));
+        strcpy(newagent, str_replace("%kernver%",      KERNVER,                    newagent));
+        strcpy(newagent, str_replace("%arch%",         ARCH,                       newagent));
+        strcpy(newagent, str_replace("%commit%",       COMMIT,                     newagent));
 
         useragent = malloc(1024);
         strcpy(useragent, newagent);