use original bookmark path

This commit is contained in:
gutmet 2021-03-14 09:47:10 +01:00
parent 4d0f11a154
commit abb5ef182b

View File

@ -77,7 +77,7 @@ static WebKitFindOptions findopts = WEBKIT_FIND_OPTIONS_CASE_INSENSITIVE |
#define SETPROP(r, s, p) { \ #define SETPROP(r, s, p) { \
.v = (const char *[]){ "/bin/sh", "-c", \ .v = (const char *[]){ "/bin/sh", "-c", \
"prop=\"$(printf '%b' \"$(xprop -id $1 $2 " \ "prop=\"$(printf '%b' \"$(xprop -id $1 $2 " \
"| sed \"s/^$2(STRING) = //;s/^\\\"\\(.*\\)\\\"$/\\1/\" && cat ~/suckless/surf/bookmarks)\" " \ "| sed \"s/^$2(STRING) = //;s/^\\\"\\(.*\\)\\\"$/\\1/\" && cat ~/.surf/bookmarks)\" " \
"| dmenu -l 10 -p \"$4\" -w $1)\" && " \ "| dmenu -l 10 -p \"$4\" -w $1)\" && " \
"xprop -id $1 -f $3 8s -set $3 \"$prop\"", \ "xprop -id $1 -f $3 8s -set $3 \"$prop\"", \
"surf-setprop", winid, r, s, p, NULL \ "surf-setprop", winid, r, s, p, NULL \
@ -114,9 +114,9 @@ static WebKitFindOptions findopts = WEBKIT_FIND_OPTIONS_CASE_INSENSITIVE |
#define BM_ADD(r) {\ #define BM_ADD(r) {\
.v = (const char *[]){ "/bin/sh", "-c", \ .v = (const char *[]){ "/bin/sh", "-c", \
"(echo $(xprop -id $0 $1) | cut -d '\"' -f2 " \ "(echo $(xprop -id $0 $1) | cut -d '\"' -f2 " \
"| sed 's/.*https*:\\/\\/\\(www\\.\\)\\?//' && cat ~/suckless/surf/bookmarks) " \ "| sed 's/.*https*:\\/\\/\\(www\\.\\)\\?//' && cat ~/.surf/bookmarks) " \
"| awk '!seen[$0]++' > ~/suckless/surf/bookmarks.tmp && " \ "| awk '!seen[$0]++' > ~/.surf/bookmarks.tmp && " \
"mv ~/suckless/surf/bookmarks.tmp ~/suckless/surf/bookmarks", \ "mv ~/.surf/bookmarks.tmp ~/.surf/bookmarks", \
winid, r, NULL \ winid, r, NULL \
} \ } \
} }