Introduction
Introduction Statistics Contact Development Disclaimer Help
Improve SETPROP xprop parsing - surf - surf browser, a WebKit based browser
git clone git://git.suckless.org/surf
Log
Files
Refs
README
LICENSE
---
commit 238d2273b50c33a1e98ad55750126f05201f911d
parent 761ea9e4c6c4d8aba4a4d39da9c9b4db8ac471b1
Author: Quentin Rameau <[email protected]>
Date: Thu, 1 Jul 2021 23:40:39 +0200
Improve SETPROP xprop parsing
This handles correctly quotes, backslashes, etc.
Diffstat:
M config.def.h | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/config.def.h b/config.def.h
@@ -67,10 +67,12 @@ static WebKitFindOptions findopts = WEBKIT_FIND_OPTIONS_CAS…
/* SETPROP(readprop, setprop, prompt)*/
#define SETPROP(r, s, p) { \
.v = (const char *[]){ "/bin/sh", "-c", \
- "prop=\"$(printf '%b' \"$(xprop -id $1 $2 " \
- "| sed \"s/^$2(STRING) = //;s/^\\\"\\(.*\\)\\\"$/\\1/\")\" " \
- "| dmenu -p \"$4\" -w $1)\" && xprop -id $1 -f $3 8s -set $3 \"$p…
- "surf-setprop", winid, r, s, p, NULL \
+ "prop=\"$(printf '%b' \"$(xprop -id $1 "r" " \
+ "| sed -e 's/^"r"(STRING) = \"\\(.*\\)\"/\\1/' " \
+ " -e 's/\\\\\\(.\\)/\\1/g')\" " \
+ "| dmenu -p '"p"' -w $1)\" " \
+ "&& xprop -id $1 -f "s" 8s -set "s" \"$prop\"", \
+ "surf-setprop", winid, NULL \
} \
}
You are viewing proxied material from suckless.org. The copyright of proxied material belongs to its original authors. Any comments or complaints in relation to proxied material should be directed to the original authors of the content concerned. Please see the disclaimer for more details.