add backup shortcut to open in a different browser
This commit is contained in:
parent
c3d627f922
commit
459784029b
4
config.h
4
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 }
|
||||
};
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user