Compare commits
6 Commits
20a0c15caa
...
b922d15f98
Author | SHA1 | Date | |
---|---|---|---|
b922d15f98 | |||
c4a4a73302 | |||
708193f82a | |||
459784029b | |||
c3d627f922 | |||
9c2c34743f |
8
config.h
8
config.h
|
@ -98,6 +98,7 @@ typedef enum {
|
||||||
|
|
||||||
prettify,
|
prettify,
|
||||||
save_uri_to_txt,
|
save_uri_to_txt,
|
||||||
|
open_uri_in_brave,
|
||||||
} func;
|
} func;
|
||||||
|
|
||||||
static struct {
|
static struct {
|
||||||
|
@ -133,8 +134,9 @@ static struct {
|
||||||
{ CTRL, KEY(f), show_finder },
|
{ CTRL, KEY(f), show_finder },
|
||||||
{ CTRL, KEY(n), finder_next },
|
{ CTRL, KEY(n), finder_next },
|
||||||
{ CTRL, KEY(N), finder_prev },
|
{ CTRL, KEY(N), finder_prev },
|
||||||
{ CTRL, KEY(Left), halve_window },
|
{ CTRL, KEY(Up), halve_window },
|
||||||
{ CTRL, KEY(Right), rebig_window },
|
{ CTRL, KEY(Down), rebig_window },
|
||||||
{ CTRL, KEY(p), prettify },
|
{ 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 }
|
||||||
};
|
};
|
||||||
|
|
|
@ -19,10 +19,10 @@ int libre_redirect(const char* uri, char* output)
|
||||||
"https://www.reddit.com",
|
"https://www.reddit.com",
|
||||||
"https://vitalik.ca",
|
"https://vitalik.ca",
|
||||||
"https://www.youtube.com",
|
"https://www.youtube.com",
|
||||||
"https://google.com",
|
// "https://google.com",
|
||||||
"https://medium.com",
|
"https://medium.com",
|
||||||
"https://translate.google.com",
|
"https://translate.google.com",
|
||||||
"https://www.bloomberg.com",
|
// "https://www.bloomberg.com",
|
||||||
"https://www.royalroad.com",
|
"https://www.royalroad.com",
|
||||||
"https://genius.com",
|
"https://genius.com",
|
||||||
// "https://twitter.com"
|
// "https://twitter.com"
|
||||||
|
@ -31,15 +31,15 @@ int libre_redirect(const char* uri, char* output)
|
||||||
};
|
};
|
||||||
|
|
||||||
char* alternatives[] = {
|
char* alternatives[] = {
|
||||||
"https://redlib.ducks.party",
|
"https://redlib.tux.pizza",
|
||||||
// previously: "https://old.reddit.com", "https://teddit.nunosempere.com",
|
// previously: "https://old.reddit.com", "https://teddit.nunosempere.com",
|
||||||
// https://github.com/redlib-org/redlib-instances/blob/main/instances.md
|
// https://github.com/redlib-org/redlib-instances/blob/main/instances.md
|
||||||
"https://vitalik.eth.limo",
|
"https://vitalik.eth.limo",
|
||||||
"https://invidious.private.coffee",
|
"https://invidious.private.coffee",
|
||||||
"https://search.nunosempere.com",
|
// "https://search.nunosempere.com",
|
||||||
"https://scribe.rip",
|
"https://scribe.rip",
|
||||||
"https://translate.riverside.rocks",
|
"https://translate.riverside.rocks",
|
||||||
"https://archive.ph/https://www.bloomberg.com",
|
// "https://archive.ph/https://www.bloomberg.com",
|
||||||
"https://royalread.nunosempere.com",
|
"https://royalread.nunosempere.com",
|
||||||
"https://dumb.vern.cc",
|
"https://dumb.vern.cc",
|
||||||
"https://example.com"
|
"https://example.com"
|
||||||
|
|
13
rosenrot4.c
13
rosenrot4.c
|
@ -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,
|
WEBKIT_FIND_OPTIONS_CASE_INSENSITIVE | WEBKIT_FIND_OPTIONS_WRAP_AROUND,
|
||||||
G_MAXUINT);
|
G_MAXUINT);
|
||||||
|
|
||||||
gtk_widget_hide(GTK_WIDGET(bar.widget));
|
gtk_widget_set_visible(GTK_WIDGET(bar.widget), 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Shortcuts */
|
/* Shortcuts */
|
||||||
|
@ -374,10 +374,19 @@ int handle_shortcut(func id)
|
||||||
if (f == NULL) {
|
if (f == NULL) {
|
||||||
printf("Error opening /opt/rosenrot/uris.txt");
|
printf("Error opening /opt/rosenrot/uris.txt");
|
||||||
} else {
|
} else {
|
||||||
fprintf(f, "%s", uri);
|
fprintf(f, "%s\n", uri);
|
||||||
fclose(f);
|
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);
|
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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user