aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md2
-rw-r--r--config.def.h30
-rwxr-xr-xrose-mklink2
-rw-r--r--rose.c4
4 files changed, 32 insertions, 6 deletions
diff --git a/README.md b/README.md
index bf0bb60..f622ea0 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,4 @@
-<h3 align=center> Rose Browser</h1>
+<h3 align=center> Rose Browser</h3>
<h4 align=center>Minimal browser based on webkit2gtk</h4>
#### Features
diff --git a/config.def.h b/config.def.h
index cb3c2cf..fc5f0e4 100644
--- a/config.def.h
+++ b/config.def.h
@@ -20,14 +20,16 @@
#define GTK "gtk-application-prefer-dark-theme", true, "gtk-enable-animations", false
-#define HOME "https://duckduckgo.com"
-#define SEARCH "https://duckduckgo.com/?q=%s"
+#define HOME "https://lite.duckduckgo.com/html/"
+#define SEARCH "https://lite.duckduckgo.com/html/?q=%s"
#define CACHE_DIR "/home/fenze/.cache/rose"
#define KEY(x) GDK_KEY_##x
#define ZOOM 1 /* Starting zoom level */
#define ZOOM_VAL .1 /* Zooming value in zoomin/zoomout functions */
-#define BG_COLOR "#1E1E2E"
+#define BG_COLOR "#1E1E2E" /* or e.g., "#FEFEFE" if not using dark theme */
+#define WIDTH 500
+#define HEIGHT 400
typedef enum {
goback,
@@ -74,3 +76,25 @@ static struct {
{ CTRL, KEY(n), finder_next },
{ CTRL | SFT, KEY(N), finder_prev }
};
+/* For controls more akin to normal browsers, use:
+{
+ { CTRL, KEY(h), goback },
+ { CTRL, KEY(j), goforward },
+ { CTRL, KEY(r), refresh },
+ { CTRL | SFT, KEY(R), refresh_force },
+ { CTRL | SFT, KEY(H), back_to_home },
+ { CTRL, KEY(equal), zoomin },
+ { CTRL, KEY(minus), zoomout },
+ { CTRL, KEY(0), zoom_reset },
+ { CTRL, KEY(Page_Down), prev_tab },
+ { CTRL, KEY(Page_Up), next_tab },
+ { CTRL, KEY(w), close_tab },
+ { 0x0, KEY(F11), toggle_fullscreen },
+ { CTRL, KEY(l), show_searchbar },
+ { CTRL, KEY(f), show_finder },
+ { CTRL, KEY(n), finder_next },
+ { CTRL | SFT, KEY(N), finder_prev }
+};
+*/
+/* Reference for the key shorthand:
+ * <https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gdk/gdkkeysyms.h> */
diff --git a/rose-mklink b/rose-mklink
index a56f321..a658930 100755
--- a/rose-mklink
+++ b/rose-mklink
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
test "$1" = "--help" || test -z "$1" && {
echo -e "usage: rose-mklink <alias> <url>\n"
diff --git a/rose.c b/rose.c
index 326ef8d..15baf7d 100644
--- a/rose.c
+++ b/rose.c
@@ -296,7 +296,7 @@ void setup(GtkNotebook *notebook, const char *uri)
bar = GTK_HEADER_BAR(gtk_header_bar_new());
search_buf = GTK_ENTRY_BUFFER(gtk_entry_buffer_new("", 0));
search = GTK_ENTRY(gtk_entry_new_with_buffer(search_buf));
-
+ gtk_window_set_default_size(window, WIDTH, HEIGHT);
window_init(notebook);
notebook_init(notebook, uri);
@@ -305,6 +305,8 @@ void setup(GtkNotebook *notebook, const char *uri)
gtk_container_add(GTK_CONTAINER(window), GTK_WIDGET(notebook));
gtk_widget_show_all(GTK_WIDGET(window));
gtk_widget_hide(GTK_WIDGET(bar));
+ webkit_web_view_set_zoom_level(notebook_get_webview(notebook), ZOOM);
+
}
int main(int argc, char **argv)