commit 82ffd49425e1b5df3e9f07688ebc6a250c8f3d77
parent 2d149f0dc7cf6ea2766179f832b75c209c57a609
Author: MikoĊaj Lenczewski <mblenczewski@gmail.com>
Date: Thu, 6 Feb 2025 17:58:25 +0000
Update base url, add download support
Diffstat:
3 files changed, 16 insertions(+), 2 deletions(-)
diff --git a/api.c b/api.c
@@ -112,6 +112,15 @@ search(struct browse_client *client, union browse_keybind_arg const *arg)
}
void
+download(struct browse_client *client, union browse_keybind_arg const *arg)
+{
+ assert(client);
+ assert(arg);
+
+ browse_download_uri(client, client->url);
+}
+
+void
toggle(struct browse_client *client, union browse_keybind_arg const *arg)
{
assert(client);
diff --git a/browse.h b/browse.h
@@ -105,6 +105,9 @@ extern void
search(struct browse_client *client, union browse_keybind_arg const *arg);
extern void
+download(struct browse_client *client, union browse_keybind_arg const *arg);
+
+extern void
toggle(struct browse_client *client, union browse_keybind_arg const *arg);
#endif /* BROWSE_H */
diff --git a/config.def.h b/config.def.h
@@ -1,7 +1,7 @@
#include "browse.h"
-static char const start_page[] = "https://searx.mblenczewski.com";
-static char const search_page[] = "https://searx.mblenczewski.com/search?q=%s";
+static char const start_page[] = "https://searx.lenczewski.org";
+static char const search_page[] = "https://searx.lenczewski.org/search?q=%s";
static char const download_fpath_fmt[] = "/tmp/%s";
@@ -50,5 +50,7 @@ static const struct browse_keybind keybinds[] = {
{ MODKEY, GDK_KEY_g, search, SEARCH_PROC, },
+ { MODKEY, GDK_KEY_d, download, { 0 }, },
+
{ MODKEY|GDK_SHIFT_MASK, GDK_KEY_T, toggle, { .i = BROWSE_PROP_STRICT_TLS, }, },
};