Compare commits

..

6 Commits

3 changed files with 21 additions and 10 deletions

View File

@ -98,6 +98,7 @@ typedef enum {
prettify,
save_uri_to_txt,
open_uri_in_brave,
} func;
static struct {
@ -133,8 +134,9 @@ static struct {
{ CTRL, KEY(f), show_finder },
{ CTRL, KEY(n), finder_next },
{ CTRL, KEY(N), finder_prev },
{ CTRL, KEY(Left), halve_window },
{ CTRL, KEY(Right), rebig_window },
{ 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 }
};

View File

@ -19,10 +19,10 @@ int libre_redirect(const char* uri, char* output)
"https://www.reddit.com",
"https://vitalik.ca",
"https://www.youtube.com",
"https://google.com",
// "https://google.com",
"https://medium.com",
"https://translate.google.com",
"https://www.bloomberg.com",
// "https://www.bloomberg.com",
"https://www.royalroad.com",
"https://genius.com",
// "https://twitter.com"
@ -31,15 +31,15 @@ int libre_redirect(const char* uri, char* output)
};
char* alternatives[] = {
"https://redlib.ducks.party",
"https://redlib.tux.pizza",
// previously: "https://old.reddit.com", "https://teddit.nunosempere.com",
// https://github.com/redlib-org/redlib-instances/blob/main/instances.md
"https://vitalik.eth.limo",
"https://invidious.private.coffee",
"https://search.nunosempere.com",
// "https://search.nunosempere.com",
"https://scribe.rip",
"https://translate.riverside.rocks",
"https://archive.ph/https://www.bloomberg.com",
// "https://archive.ph/https://www.bloomberg.com",
"https://royalread.nunosempere.com",
"https://dumb.vern.cc",
"https://example.com"

View File

@ -245,7 +245,7 @@ void handle_signal_bar_press_enter(GtkEntry* self, GtkNotebook* notebook) /* con
WEBKIT_FIND_OPTIONS_CASE_INSENSITIVE | WEBKIT_FIND_OPTIONS_WRAP_AROUND,
G_MAXUINT);
gtk_widget_hide(GTK_WIDGET(bar.widget));
gtk_widget_set_visible(GTK_WIDGET(bar.widget), 0);
}
/* Shortcuts */
@ -374,10 +374,19 @@ int handle_shortcut(func id)
if (f == NULL) {
printf("Error opening /opt/rosenrot/uris.txt");
} else {
fprintf(f, "%s", uri);
fprintf(f, "%s\n", uri);
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);
const char* brave_command = "brave-browser --app=%s --new-window --start-fullscreen &";
char cmd[strlen(brave_command) + strlen(uri) + 2];
snprintf(cmd, sizeof(cmd) + 1, brave_command, uri);
system(cmd);
break;
}
}