]> git.armaanb.net Git - chorizo.git/commitdiff
Add tab jump hotkeys
authorArmaan Bhojwani <me@armaanb.net>
Sun, 6 Jun 2021 17:28:52 +0000 (13:28 -0400)
committerArmaan Bhojwani <me@armaanb.net>
Sun, 6 Jun 2021 17:28:52 +0000 (13:28 -0400)
browser.c
man/lariza-config.5.scd

index e3bb431c29b67b9d166d65937eab7860c6dca08a..e54f5493c227fae99eb5da68ca29a7cb905e6c67 100644 (file)
--- a/browser.c
+++ b/browser.c
@@ -977,6 +977,33 @@ key_common(GtkWidget *widget, GdkEvent *event, gpointer data)
                        } else if (def_key("tab_close", GDK_KEY_q) == key) {
                                client_destroy(NULL, c);
                                return TRUE;
+                       } else if (def_key("tab_switch_1", GDK_KEY_1) == key) {
+                               gtk_notebook_set_current_page(GTK_NOTEBOOK(mw.notebook), 0);
+                               return TRUE;
+                       } else if (def_key("tab_switch_2", GDK_KEY_2) == key) {
+                               gtk_notebook_set_current_page(GTK_NOTEBOOK(mw.notebook), 1);
+                               return TRUE;
+                       } else if (def_key("tab_switch_3", GDK_KEY_3) == key) {
+                               gtk_notebook_set_current_page(GTK_NOTEBOOK(mw.notebook), 2);
+                               return TRUE;
+                       } else if (def_key("tab_switch_4", GDK_KEY_4) == key) {
+                               gtk_notebook_set_current_page(GTK_NOTEBOOK(mw.notebook), 3);
+                               return TRUE;
+                       } else if (def_key("tab_switch_5", GDK_KEY_5) == key) {
+                               gtk_notebook_set_current_page(GTK_NOTEBOOK(mw.notebook), 4);
+                               return TRUE;
+                       } else if (def_key("tab_switch_6", GDK_KEY_6) == key) {
+                               gtk_notebook_set_current_page(GTK_NOTEBOOK(mw.notebook), 5);
+                               return TRUE;
+                       } else if (def_key("tab_switch_7", GDK_KEY_7) == key) {
+                               gtk_notebook_set_current_page(GTK_NOTEBOOK(mw.notebook), 6);
+                               return TRUE;
+                       } else if (def_key("tab_switch_8", GDK_KEY_8) == key) {
+                               gtk_notebook_set_current_page(GTK_NOTEBOOK(mw.notebook), 7);
+                               return TRUE;
+                       } else if (def_key("tab_switch_9", GDK_KEY_9) == key) {
+                               gtk_notebook_set_current_page(GTK_NOTEBOOK(mw.notebook), 8);
+                               return TRUE;
                        } else if (def_key("tab_previous", GDK_KEY_u) == key) {
                                gtk_notebook_prev_page(GTK_NOTEBOOK(mw.notebook));
                                return TRUE;
index 89ec83b66588ef509ec00ab2905c9e2b53bda3ba..7e9b2b77bca95dfe4fa6a3dd72bf3734e17fa9ee 100644 (file)
@@ -147,6 +147,12 @@ All of these keybindings are bound to Control + key.
        Default: q++
        Close the current tab.
 
+*tab_switch_[1-9]*++
+       Type: string++
+       Default: [1-9]++
+       Group of options to jump to a particular tab, numbered from the left. Set
+       these separately from each other.
+
 *tab_previous*++
        Type: string++
        Default: u++