X-Git-Url: https://git.danieliu.xyz/?p=surf.git;a=blobdiff_plain;f=config.def.h;h=e8e1c50b5ec6e817066f274bfcf2dd100faf14dd;hp=73f65e611f35f8485fc45e423ec7b5f2083fc966;hb=HEAD;hpb=f92d63f4c0acfc63239453bca92dab9d66afc000 diff --git a/config.def.h b/config.def.h index 73f65e6..e8e1c50 100644 --- a/config.def.h +++ b/config.def.h @@ -6,11 +6,13 @@ static char *styledir = "~/.surf/styles/"; static char *certdir = "~/.surf/certificates/"; static char *cachedir = "~/.surf/cache/"; static char *cookiefile = "~/.surf/cookies.txt"; +static char *historyfile = "~/.surf/history.txt"; static SearchEngine searchengines[] = { { "g", "https://www.google.com/search?q=%s" }, { "ji", "https://jisho.org/search/%s" }, - { "aw", "https://wiki.archlinux.org/index.php?search=%s" } + { "aw", "https://wiki.archlinux.org/index.php?search=%s" }, + { "s", "https://searx.danieliu.xyz/?q=%s" } }; /* Webkit default features */ @@ -105,7 +107,7 @@ static WebKitFindOptions findopts = WEBKIT_FIND_OPTIONS_CASE_INSENSITIVE | /* VIDEOPLAY(URI) */ #define VIDEOPLAY(u) {\ .v = (const char *[]){ "/bin/sh", "-c", \ - "mpv --really-quiet \"$0\"", u, NULL \ + "notify-send 'Opening video in mpv...' & mpv --really-quiet \"$0\"", u, NULL \ } \ } @@ -120,6 +122,11 @@ static WebKitFindOptions findopts = WEBKIT_FIND_OPTIONS_CASE_INSENSITIVE | } \ } +#define SETURI(p) { .v = (char *[]){ "/bin/sh", "-c", \ +"prop=\"`surf_history_dmenu.sh`\" &&" \ +"xprop -id $1 -f $0 8s -set $0 \"$prop\"", \ +p, winid, NULL } } + /* styles */ /* * The iteration will stop at the first match, beginning at the beginning of @@ -153,6 +160,8 @@ static Key keys[] = { { MODKEY, GDK_KEY_slash, spawn, SETPROP("_SURF_FIND", "_SURF_FIND", PROMPT_FIND) }, { MODKEY, GDK_KEY_m, spawn, BM_ADD("_SURF_URI") }, + { MODKEY, GDK_KEY_w, playexternal, { 0 } }, + { 0, GDK_KEY_Escape, stop, { 0 } }, { MODKEY, GDK_KEY_c, stop, { 0 } }, @@ -199,6 +208,7 @@ static Key keys[] = { { MODKEY|GDK_SHIFT_MASK, GDK_KEY_b, toggle, { .i = ScrollBars } }, { MODKEY|GDK_SHIFT_MASK, GDK_KEY_t, toggle, { .i = StrictTLS } }, { MODKEY|GDK_SHIFT_MASK, GDK_KEY_m, toggle, { .i = Style } }, + { MODKEY , GDK_KEY_Return, spawn, SETURI("_SURF_GO") }, }; /* button definitions */ @@ -213,4 +223,4 @@ static Button buttons[] = { { OnMedia, MODKEY, 1, clickexternplayer, { 0 }, 1 }, }; -#define HOMEPAGE "https://duckduckgo.com/" +#define HOMEPAGE "https://danieliu.xyz/"