]> git.armaanb.net Git - chorizo.git/commitdiff
Alphabetize config options
authorArmaan Bhojwani <me@armaanb.net>
Sun, 6 Jun 2021 14:26:54 +0000 (10:26 -0400)
committerArmaan Bhojwani <me@armaanb.net>
Sun, 6 Jun 2021 14:26:54 +0000 (10:26 -0400)
browser.c
man1/lariza-config.5.scd

index d10ccb5ce3d05c5e26f74984b6ad208268c1d8d9..3f4765d3d8bb27fc3accde23fd0843a58dbdc230 100644 (file)
--- a/browser.c
+++ b/browser.c
@@ -902,30 +902,14 @@ key_common(GtkWidget *widget, GdkEvent *event, gpointer data)
                        WebKitSettings *settings = webkit_web_view_get_settings(WEBKIT_WEB_VIEW(c->web_view));
                        gboolean js = webkit_settings_get_enable_javascript(settings);
                        int key = ((GdkEventKey *)event)->keyval;
-                       if (def_key("close_tab", GDK_KEY_q) == key) {
-                               client_destroy(NULL, c);
-                               return TRUE;
-                       } else if (def_key("new_tab", GDK_KEY_w) == key) {
-                               f = ensure_uri_scheme(cfg.home_uri);
-                               client_new(f, NULL, TRUE, TRUE);
-                               g_free(f);
-                               return TRUE;
-                       } else if (def_key("reload", GDK_KEY_e) == key) {
-                               webkit_web_view_reload_bypass_cache(WEBKIT_WEB_VIEW(c->web_view));
-                               return TRUE;
-                       } else if (def_key("download_manager", GDK_KEY_y) == key) {
+                       if (def_key("download_manager", GDK_KEY_y) == key) {
                                gtk_widget_show_all(dm.win);
                                return TRUE;
-                       } else if (def_key("web_search", GDK_KEY_d) == key) {
-                               gtk_widget_grab_focus(c->location);
-                               gtk_entry_set_text(GTK_ENTRY(c->location), "w/");
-                               gtk_editable_set_position(GTK_EDITABLE(c->location), -1);
-                               return TRUE;
-                       } else if (def_key("search_forwards", GDK_KEY_s) == key) {
-                               search_init(c, 1);
+                       } else if (def_key("history_back", GDK_KEY_h) == key) {
+                               webkit_web_view_go_back(WEBKIT_WEB_VIEW(c->web_view));
                                return TRUE;
-                       } else if (def_key("search_backwards", GDK_KEY_r) == key) {
-                               search_init(c, -1);
+                       } else if (def_key("history_forwards", GDK_KEY_l) == key) {
+                               webkit_web_view_go_forward(WEBKIT_WEB_VIEW(c->web_view));
                                return TRUE;
                        } else if (def_key("location", GDK_KEY_t) == key) {
                                gtk_widget_grab_focus(c->location);
@@ -934,25 +918,26 @@ key_common(GtkWidget *widget, GdkEvent *event, gpointer data)
                                gtk_entry_set_text(GTK_ENTRY(c->location), goal);
                                gtk_editable_set_position(GTK_EDITABLE(c->location), -1);
                                return TRUE;
-                       } else if (def_key("previous_tab", GDK_KEY_u) == key) {
-                               gtk_notebook_prev_page(GTK_NOTEBOOK(mw.notebook));
-                               return TRUE;
-                       } else if (def_key("next_tab", GDK_KEY_i) == key) {
-                               gtk_notebook_next_page(GTK_NOTEBOOK(mw.notebook));
-                               return TRUE;
-                       } else if (def_key("history_back", GDK_KEY_h) == key) {
-                               webkit_web_view_go_back(WEBKIT_WEB_VIEW(c->web_view));
+                       } else if (def_key("quit", GDK_KEY_g) == key) {
+                               search(c, 2);
+                               gtk_widget_grab_focus(c->web_view);
+                               gtk_entry_set_text(GTK_ENTRY(c->location),
+                                                                                                        webkit_web_view_get_uri(WEBKIT_WEB_VIEW(c->web_view)));
+                               webkit_web_view_run_javascript(WEBKIT_WEB_VIEW(c->web_view),
+                                                                                                                                                        "window.getSelection().removeAllRanges();"
+                                                                                                                                                        "document.activeElement.blur();",
+                                                                                                                                                        NULL, NULL, c);
                                return TRUE;
-                       } else if (def_key("history_forwards", GDK_KEY_l) == key) {
-                               webkit_web_view_go_forward(WEBKIT_WEB_VIEW(c->web_view));
+                       } else if (def_key("reload", GDK_KEY_e) == key) {
+                               webkit_web_view_reload_bypass_cache(WEBKIT_WEB_VIEW(c->web_view));
                                return TRUE;
-                       } else if (def_key("scroll_down", GDK_KEY_j) == key) {
+                       } else if (def_key("scroll_line_down", GDK_KEY_j) == key) {
                                for (int i = 0; i < 2; i++) {
                                        event->key.keyval = GDK_KEY_Down;
                                        gdk_event_put(event);
                                }
                                return TRUE;
-                       } else if (def_key("scroll_up", GDK_KEY_k) == key) {
+                       } else if (def_key("scroll_line_up", GDK_KEY_k) == key) {
                                event->key.keyval = GDK_KEY_Up;
                                gdk_event_put(event);
                                return TRUE;
@@ -964,19 +949,34 @@ key_common(GtkWidget *widget, GdkEvent *event, gpointer data)
                                event->key.keyval = GDK_KEY_Page_Up;
                                gdk_event_put(event);
                                return TRUE;
+                       } else if (def_key("search_forwards", GDK_KEY_s) == key) {
+                               search_init(c, 1);
+                               return TRUE;
+                       } else if (def_key("search_backwards", GDK_KEY_r) == key) {
+                               search_init(c, -1);
+                               return TRUE;
+                       } else if (def_key("tab_close", GDK_KEY_q) == key) {
+                               client_destroy(NULL, c);
+                               return TRUE;
+                       } else if (def_key("tab_previous", GDK_KEY_u) == key) {
+                               gtk_notebook_prev_page(GTK_NOTEBOOK(mw.notebook));
+                               return TRUE;
+                       } else if (def_key("tab_new", GDK_KEY_w) == key) {
+                               f = ensure_uri_scheme(cfg.home_uri);
+                               client_new(f, NULL, TRUE, TRUE);
+                               g_free(f);
+                               return TRUE;
+                       } else if (def_key("tab_next", GDK_KEY_i) == key) {
+                               gtk_notebook_next_page(GTK_NOTEBOOK(mw.notebook));
+                               return TRUE;
                        } else if (def_key("toggle_js", GDK_KEY_o) == key) {
                                webkit_settings_set_enable_javascript(settings, (js) ? FALSE : TRUE);
                                webkit_web_view_set_settings(WEBKIT_WEB_VIEW(c->web_view), settings);
                                return TRUE;
-                       } else if (def_key("quit", GDK_KEY_g) == key) {
-                               search(c, 2);
-                               gtk_widget_grab_focus(c->web_view);
-                               gtk_entry_set_text(GTK_ENTRY(c->location),
-                                                                                                        webkit_web_view_get_uri(WEBKIT_WEB_VIEW(c->web_view)));
-                               webkit_web_view_run_javascript(WEBKIT_WEB_VIEW(c->web_view),
-                                                                                                                                                        "window.getSelection().removeAllRanges();"
-                                                                                                                                                        "document.activeElement.blur();",
-                                                                                                                                                        NULL, NULL, c);
+                       } else if (def_key("web_search", GDK_KEY_d) == key) {
+                               gtk_widget_grab_focus(c->location);
+                               gtk_entry_set_text(GTK_ENTRY(c->location), "w/");
+                               gtk_editable_set_position(GTK_EDITABLE(c->location), -1);
                                return TRUE;
                        } else if (def_key("zoom_in", GDK_KEY_equal) == key) {
                                now = webkit_web_view_get_zoom_level(WEBKIT_WEB_VIEW(c->web_view));
index 3ab31a70d50a09c73fffc015635bcee5d377bd6a..aa71527aac8a6ccfed5b03cac070f35b54c89f92 100644 (file)
@@ -12,6 +12,22 @@ subsection.
 
 # OPTIONS
 ## BROWSER
+*accepted_language*++
+       Type: string++
+       Default: NULL++
+       Set the accepted language header.
+
+*console_to_stdout*++
+       Type: boolean++
+       Default: false++
+       Print the contents of the browser console to stdout.
+
+*cookie_policy*++
+       Type: string++
+       Default: "no_third_party"++
+       Options: "all", "none", "no_third_party"++
+       Determines what cookies are accepted.
+
 *history_file*++
        Type: string++
        Default: none++
@@ -22,32 +38,21 @@ subsection.
        Default: "about:blank"++
        Set the default URI for new tabs.
 
-*console_to_stdout*++
-       Type: boolean++
-       Default: false++
-       Print the contents of the browser console to stdout.
-
-*user_agent*++
-       Type: string++
-       Default: the WebKit default++
-       Choose a custom user agent.
-
 *javascript_disabled*++
        Type: boolean++
        Default: false++
        Determines whether or not JavaScript is enabled by default.
 
-*cookie_policy*++
-       Type: string++
-       Default: "no_third_party"++
-       Options: "all", "none", "no_third_party"++
-       Determines what cookies are accepted.
-
 *search_engine*++
        Type: string++
        Default: "https://duckduckgo.com?q="++
        What search engine to use when searching with "w/".
 
+*user_agent*++
+       Type: string++
+       Default: the WebKit default++
+       Choose a custom user agent.
+
 ## UI
 *tab_width*++
        Type: integer++
@@ -62,72 +67,42 @@ subsection.
 ## KEYBINDINGS
 All of these keybindings are bound to Control + key.
 
-*close_tab*++
-       Type: string++
-       Default: q++
-       Close the current tab.
-
-*new_tab*++
-       Type: string++
-       Default: w++
-       Open a new tab.
-
-*reload*++
-       Type: string++
-       Default: e++
-       Reload the current tab.
-
 *download_manager*++
        Type: string++
        Default: y++
        Toggle the download manager.
 
-*web_search*++
-       Type: string++
-       Default: d++
-       Start a web search.
-
-*search_forwards*++
+*history_back*++
        Type: string++
-       Default: s++
-       Search in-page forwards.
+       Default: h++
+       Go back in history.
 
-*search_backwards*++
+*history_forwards*++
        Type: string++
-       Default: r++
-       Search in-page backwareds.
+       Default: h++
+       Go forwards in history.
 
 *location*++
        Type: string++
        Default: t++
        Select the URL.
 
-*previous_tab*++
-       Type: string++
-       Default: u++
-       Focus the previous tab.
-
-*next_tab*++
-       Type: string++
-       Default: i++
-       Focus the next tab.
-
-*history_forwards*++
+*quit*++
        Type: string++
-       Default: h++
-       Go forwards in history.
+       Default: g++
+       Deselect everything and focus on the webpage.
 
-*history_back*++
+*reload*++
        Type: string++
-       Default: h++
-       Go back in history.
+       Default: e++
+       Reload the current tab.
 
-*scroll_down*++
+*scroll_line_down*++
        Type: string++
        Default: j++
        Scroll down one line.
 
-*scroll_up*++
+*scroll_line_up*++
        Type: string++
        Default: k++
        Scroll up one line.
@@ -142,15 +117,45 @@ All of these keybindings are bound to Control + key.
        Default: b++
        Scroll up one page.
 
+*search_backwards*++
+       Type: string++
+       Default: r++
+       Search in-page backwareds.
+
+*search_forwards*++
+       Type: string++
+       Default: s++
+       Search in-page forwards.
+
+*tab_close*++
+       Type: string++
+       Default: q++
+       Close the current tab.
+
+*tab_previous*++
+       Type: string++
+       Default: u++
+       Focus the previous tab.
+
+*tab_new*++
+       Type: string++
+       Default: w++
+       Open a new tab.
+
+*tab_next*++
+       Type: string++
+       Default: i++
+       Focus the next tab.
+
 *toggle_js*++
        Type: string++
        Default: o++
        Toggle JavaScript.
 
-*quit*++
+*web_search*++
        Type: string++
-       Default: g++
-       Deselect everything and focus on the webpage.
+       Default: d++
+       Start a web search.
 
 *zoom_in*++
        Type: string++