Compare commits

...

2 Commits

Author SHA1 Message Date
b3a0f14b2f tweak: allow rose.desktop to be used as default mime type
and add instructions to do so.
2023-01-04 15:42:08 +01:00
4958d9eeaa tweaks: redirect wikipedia to wikiless & add max tab title length. 2022-12-27 15:39:18 +01:00
4 changed files with 27 additions and 5 deletions

View File

@ -34,7 +34,8 @@ int libre_redirect(const char* uri, char* output){
"https://translate.google.com",
"https://forum.effectivealtruism.org",
"https://www.bloomberg.com",
"https://twitter.com"
"https://twitter.com",
"https://wikipedia.org"
};
char* alternatives[] = {
"https://yt.artemislena.eu",
@ -43,7 +44,8 @@ int libre_redirect(const char* uri, char* output){
"https://simplytranslate.org/",
"https://ea.greaterwrong.com",
"https://archive.is/https://www.bloomberg.com",
"https://nitter.net"
"https://nitter.net",
"https://wikiless.org"
};
int n = sizeof(annoying_sites)/sizeof(annoying_sites[0]);
for(int i=0; i<n ; i++){

16
rose.c
View File

@ -115,9 +115,21 @@ void load_changed(WebKitWebView *self, WebKitLoadEvent load_event, GtkNotebook *
break;
case WEBKIT_LOAD_FINISHED:
{
const char* title = webkit_web_view_get_title(self);
const char* webpage_title = webkit_web_view_get_title(self);
const int max_length = 25;
char tab_title[max_length + 1];
if(webpage_title != NULL){
for(int i = 0; i<(max_length); i++){
tab_title[i] = webpage_title[i];
if(webpage_title[i] == '\0'){
break;
}
}
tab_title[max_length] = '\0';
}
gtk_notebook_set_tab_label_text(notebook, GTK_WIDGET(self),
title == NULL ? "" : title );
webpage_title == NULL ? "" : tab_title );
// gtk_widget_hide(GTK_WIDGET(bar));
break;
}

View File

@ -3,7 +3,7 @@
Version=1.0
Type=Application
Terminal=false
Exec= /usr/bin/rose
Exec= /usr/bin/rose %u
Name=Rose
Comment=Minimalistic browser
Icon=/home/loki/Documents/core/software/fresh/C/rose-browser/rose-bud-personal/user-scripts/ubuntu-20.04/rose-images/rose-desktop-icon.png

View File

@ -0,0 +1,8 @@
# Requires:
# sudo cp rose.desktop /usr/share/applications
xdg-mime default rose.desktop x-scheme-handler/https
xdg-mime default rose.desktop x-scheme-handler/http
# This is useful e.g., for setting how to open
# links in vim when pressing gx.