diff options
author | Quentin Rameau <quinq@fifth.space> | 2017-05-08 11:22:34 +0200 |
---|---|---|
committer | Quentin Rameau <quinq@fifth.space> | 2017-05-08 11:34:00 +0200 |
commit | 47b145f2ec79ce79172bcd4fd36149c34d9085df (patch) | |
tree | dcff824baf346eb686d9d59fc610e68740fb5829 | |
parent | b8b0c050354d7961edeec74e644f09a3e2887074 (diff) | |
download | surf-47b145f2ec79ce79172bcd4fd36149c34d9085df.tar.gz surf-47b145f2ec79ce79172bcd4fd36149c34d9085df.tar.bz2 surf-47b145f2ec79ce79172bcd4fd36149c34d9085df.zip |
Add prompts for SETPROP
Imported from __20h__ repo, thanks to him and Ben Woolley.
-rw-r--r-- | config.def.h | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/config.def.h b/config.def.h index d90fc8d..eff9d43 100644 --- a/config.def.h +++ b/config.def.h @@ -50,13 +50,16 @@ static int winsize[] = { 800, 600 }; static WebKitFindOptions findopts = WEBKIT_FIND_OPTIONS_CASE_INSENSITIVE | WEBKIT_FIND_OPTIONS_WRAP_AROUND; -/* SETPROP(readprop, setprop)*/ -#define SETPROP(r, s) { \ +#define PROMPT_GO "URL:" +#define PROMPT_FIND "Find:" + +/* 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 -w $1)\" && xprop -id $1 -f $3 8s -set $3 \"$prop\"", \ - "surf-setprop", winid, r, s, NULL \ + "| dmenu -p \"$4\" -w $1)\" && xprop -id $1 -f $3 8s -set $3 \"$prop\"", \ + "surf-setprop", winid, r, s, p, NULL \ } \ } @@ -114,9 +117,9 @@ static SiteSpecific certs[] = { */ static Key keys[] = { /* modifier keyval function arg */ - { MODKEY, GDK_KEY_g, spawn, SETPROP("_SURF_URI", "_SURF_GO") }, - { MODKEY, GDK_KEY_f, spawn, SETPROP("_SURF_FIND", "_SURF_FIND") }, - { MODKEY, GDK_KEY_slash, spawn, SETPROP("_SURF_FIND", "_SURF_FIND") }, + { MODKEY, GDK_KEY_g, spawn, SETPROP("_SURF_URI", "_SURF_GO", PROMPT_GO) }, + { MODKEY, GDK_KEY_f, spawn, SETPROP("_SURF_FIND", "_SURF_FIND", PROMPT_FIND) }, + { MODKEY, GDK_KEY_slash, spawn, SETPROP("_SURF_FIND", "_SURF_FIND", PROMPT_FIND) }, { 0, GDK_KEY_Escape, stop, { 0 } }, { MODKEY, GDK_KEY_c, stop, { 0 } }, |