diff --git a/makefile b/makefile index 260a5cb..852e043 100644 --- a/makefile +++ b/makefile @@ -3,7 +3,7 @@ CC=gcc # alternatives: tcc, clang, zig cc WARNINGS=-Wall OPTIMIZED_SOME=-O3 OPTIMIZED_MORE=-Ofast -march=native -funit-at-a-time -flto # binary will not be compatible with other computers, but may be much faster -DEBUG=#-g +DEBUG=-g STD=-std=c99 # maybe consider moving to c11 and using safer string handling # Dependencies for WebkitGTK4/GTK3 diff --git a/rosenrot4.c b/rosenrot4.c index 6be5d40..40e8db8 100644 --- a/rosenrot4.c +++ b/rosenrot4.c @@ -414,7 +414,7 @@ int handle_shortcut(func id) 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); + if(system(cmd) == -1) printf("Error opening in brave browser"); break; } } diff --git a/user-scripts/ubuntu-24.04/install-with-dependencies-gtk3.sh b/user-scripts/ubuntu-24.04/install-with-dependencies-gtk3.sh new file mode 100644 index 0000000..fd2db47 --- /dev/null +++ b/user-scripts/ubuntu-24.04/install-with-dependencies-gtk3.sh @@ -0,0 +1,42 @@ +# Key dependencies +sudo apt install git vim gcc make +sudo apt install libwebkit2gtk-4.1-dev + +# Optional adblock +git clone https://github.com/jun7/wyebadblock +cd wyebadblock +sudo apt install gstreamer1.0-plugins-good gstreamer1.0-libav +WEBKITVER=4.1 make +sudo WEBKITVER=4.1 make install + +cd .. +mkdir -p ~/.config/wyebadblock +cd ~/.config/wyebadblock +wget https://easylist.to/easylist/easylist.txt +cd - + +cd ../.. +make build3 # or just make +sudo make install + +cd - +# Debian desktop icon +chmod +x rosenrot.desktop +sudo cp rosenrot.desktop /usr/share/applications +mkdir -p /opt/rosenrot +sudo cp rosenrot-desktop-icon.png /opt/rosenrot/ + +# Optionally, set a shortcut (within GNOME) +# https://askubuntu.com/questions/597395/how-to-set-custom-keyboard-shortcuts-from-terminal/1007035#1007035 +name="rose" +binding="W" +action="/usr/bin/rosenrot" + +media_keys=org.gnome.settings-daemon.plugins.media-keys +custom_kbd=org.gnome.settings-daemon.plugins.media-keys.custom-keybinding +kbd_path=/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/$name/ +new_bindings=`gsettings get $media_keys custom-keybindings | sed -e"s>'\]>','$kbd_path']>"| sed -e"s>@as \[\]>['$kbd_path']>"` +gsettings set $media_keys custom-keybindings "$new_bindings" +gsettings set $custom_kbd:$kbd_path name "$name" +gsettings set $custom_kbd:$kbd_path binding "$binding" +gsettings set $custom_kbd:$kbd_path command "$action" diff --git a/user-scripts/ubuntu-24.04/install-with-dependencies-gtk4.sh b/user-scripts/ubuntu-24.04/install-with-dependencies-gtk4.sh new file mode 100644 index 0000000..96557b9 --- /dev/null +++ b/user-scripts/ubuntu-24.04/install-with-dependencies-gtk4.sh @@ -0,0 +1,46 @@ +# Key dependencies +sudo apt install libwebkitgtk-6.0-dev +sudo apt install libgtk-4-dev + +# Optional adblock +# Doesn't work with webkit-6.0 +# cd ~/.local +# git clone https://github.com/jun7/wyebadblock +# cd wyebadblock +# sudo apt install libglib2.0-dev gstreamer1.0-plugins-good gstreamer1.0-libav +# WEBKITVER=6.0 make +# sudo WEBKITVER=6.0 make install +# cd - + +# cd .. +# mkdir -p ~/.config/wyebadblock +# cd ~/.config/wyebadblock +# wget https://easylist.to/easylist/easylist.txt +# cd - + +cd ../.. +make build +make runtime-files +sudo make install + +cd - +# Debian desktop icon +chmod +x rosenrot.desktop +sudo cp rosenrot.desktop /usr/share/applications +mkdir -p /opt/rosenrot +sudo cp rosenrot-desktop-icon.png /opt/rosenrot/ + +# Optionally, set a shortcut (within GNOME) +# https://askubuntu.com/questions/597395/how-to-set-custom-keyboard-shortcuts-from-terminal/1007035#1007035 +name="rose" +binding="W" +action="/usr/bin/rosenrot" + +media_keys=org.gnome.settings-daemon.plugins.media-keys +custom_kbd=org.gnome.settings-daemon.plugins.media-keys.custom-keybinding +kbd_path=/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/$name/ +new_bindings=`gsettings get $media_keys custom-keybindings | sed -e"s>'\]>','$kbd_path']>"| sed -e"s>@as \[\]>['$kbd_path']>"` +gsettings set $media_keys custom-keybindings "$new_bindings" +gsettings set $custom_kbd:$kbd_path name "$name" +gsettings set $custom_kbd:$kbd_path binding "$binding" +gsettings set $custom_kbd:$kbd_path command "$action" diff --git a/user-scripts/ubuntu-24.04/rosenrot-desktop-icon.png b/user-scripts/ubuntu-24.04/rosenrot-desktop-icon.png new file mode 100644 index 0000000..163494f Binary files /dev/null and b/user-scripts/ubuntu-24.04/rosenrot-desktop-icon.png differ diff --git a/user-scripts/ubuntu-24.04/rosenrot.desktop b/user-scripts/ubuntu-24.04/rosenrot.desktop new file mode 100755 index 0000000..e6b9494 --- /dev/null +++ b/user-scripts/ubuntu-24.04/rosenrot.desktop @@ -0,0 +1,9 @@ +#!/usr/bin/env xdg-open +[Desktop Entry] +Version=1.0 +Type=Application +Terminal=false +Exec=/bin/rosenrot %u +Name=Rosenrot +Comment=Minimalistic browser +Icon=/opt/rosenrot/rosenrot-desktop-icon.png