diff --git a/config.h b/config.h index e88a646..af13901 100644 --- a/config.h +++ b/config.h @@ -98,6 +98,7 @@ typedef enum { prettify, save_uri_to_txt, + open_uri_in_brave, } func; static struct { @@ -136,5 +137,6 @@ static struct { { CTRL, KEY(Up), halve_window }, { CTRL, KEY(Down), rebig_window }, { CTRL, KEY(p), prettify }, - { CTRL, KEY(s), save_uri_to_txt } + { CTRL, KEY(s), save_uri_to_txt }, + { CTRL, KEY(b), open_uri_in_brave } }; diff --git a/rosenrot4.c b/rosenrot4.c index c99ea62..f5dc7df 100644 --- a/rosenrot4.c +++ b/rosenrot4.c @@ -378,6 +378,14 @@ int handle_shortcut(func id) fclose(f); webkit_web_view_evaluate_javascript(view, "alert('Saved current uri to /opt/rosenrot/uris.txt')", -1, NULL, "rosenrot-alert-numtabs", NULL, NULL, NULL); } + break; + } + case open_uri_in_brave: { + const char* uri = webkit_web_view_get_uri(view); + char cmd[strlen("brave-browser --new-window ") + strlen(uri) + 1]; + snprintf(cmd, sizeof(cmd) + 1, "brave-browser --new-window %s", uri); + system(cmd); + break; } }