From 76db5e5b1d3c782533411bfd3d10fbfc1c0479e4 Mon Sep 17 00:00:00 2001 From: Armaan Bhojwani Date: Sun, 6 Jun 2021 13:28:52 -0400 Subject: [PATCH] Add tab jump hotkeys --- browser.c | 27 +++++++++++++++++++++++++++ man/lariza-config.5.scd | 6 ++++++ 2 files changed, 33 insertions(+) diff --git a/browser.c b/browser.c index e3bb431..e54f549 100644 --- 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; diff --git a/man/lariza-config.5.scd b/man/lariza-config.5.scd index 89ec83b..7e9b2b7 100644 --- a/man/lariza-config.5.scd +++ b/man/lariza-config.5.scd @@ -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++ -- 2.39.2