index.md (931B)
1 Simple bookmarking, redux 2 ========================= 3 4 Description 5 ----------- 6 Modify your config.h just before the definition of `keys[]`: 7 8 #define BM_PICK { .v = (char *[]){ "/bin/sh", "-c", \ 9 "xprop -id $0 -f _SURF_GO 8s -set _SURF_GO \ 10 `cat ~/.surf/bookmarks | dmenu || exit 0`", \ 11 winid, NULL } } 12 13 #define BM_ADD { .v = (char *[]){ "/bin/sh", "-c", \ 14 "(echo `xprop -id $0 _SURF_URI | cut -d '\"' -f 2` && \ 15 cat ~/.surf/bookmarks) | sort -u > ~/.surf/bookmarks_new && \ 16 mv ~/.surf/bookmarks_new ~/.surf/bookmarks", \ 17 winid, NULL } } 18 19 Then, inside `keys[]`, add: 20 21 { MODKEY, GDK_b, spawn, BM_PICK }, 22 { MODKEY|GDK_SHIFT_MASK,GDK_b, spawn, BM_ADD }, 23 24 ### Modkeys 25 26 **CTRL-b** 27 28 Executes dmenu(1) displaying the list of bookmarks. 29 30 **CTRL-SHIFT-b** 31 32 Adds the current page to the list of bookmarks, while removing duplicate entries. 33 34 Author 35 ------ 36 * Lorenzo Bolla `<lbolla at gmail dot com>`