From 546a4d72f9b624a45f2e3481b3e4a00e01ae7d85 Mon Sep 17 00:00:00 2001 From: Daniel Micay Date: Mon, 11 Jun 2012 14:45:38 -0400 Subject: [PATCH] add keybinding to reload configuration file --- README.rst | 1 + termite.c | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/README.rst b/README.rst index a9fb317..047ba3b 100644 --- a/README.rst +++ b/README.rst @@ -11,6 +11,7 @@ A vte version >= 0.30. KEYBINDINGS =========== +* ``ctrl-shift-escape``: reload configuration file * ``ctrl-shift-c``: copy to CLIPBOARD * ``ctrl-shift-v``: paste from CLIPBOARD * ``ctrl-shift-u``: unicode input (standard GTK binding) diff --git a/termite.c b/termite.c index a72f66e..42f5e76 100644 --- a/termite.c +++ b/termite.c @@ -44,6 +44,9 @@ static void search(VteTerminal *vte, const char *pattern, bool reverse); static void overlay_show(search_panel_info *info, overlay_mode mode, bool complete); static void get_vte_padding(VteTerminal *vte, int *w, int *h); static char *check_match(VteTerminal *vte, int event_x, int event_y); +static void load_config(GtkWindow *window, VteTerminal *vte, bool first_run, + gboolean *dynamic_title, gboolean *urgent_on_bell, + gboolean *clickable_url, double *transparency, const gchar **term); void launch_browser(char *url) { browser_cmd[1] = url; @@ -58,6 +61,8 @@ void window_title_cb(VteTerminal *vte, GtkWindow *window) { gboolean key_press_cb(VteTerminal *vte, GdkEventKey *event, search_panel_info *info) { const guint modifiers = event->state & gtk_accelerator_get_default_mod_mask(); + gboolean dynamic_title = FALSE, urgent_on_bell = FALSE, clickable_url = FALSE; + double transparency = 0.0; if (modifiers == (GDK_CONTROL_MASK|GDK_SHIFT_MASK)) { switch (gdk_keyval_to_lower(event->keyval)) { case GDK_KEY_c: @@ -86,6 +91,11 @@ gboolean key_press_cb(VteTerminal *vte, GdkEventKey *event, search_panel_info *i case GDK_KEY_k: search(vte, url_regex, true); return TRUE; + case GDK_KEY_Escape: + load_config(GTK_WINDOW(gtk_widget_get_toplevel(GTK_WIDGET(vte))), + vte, false, &dynamic_title, &urgent_on_bell, + &clickable_url, &transparency, NULL); + return TRUE; } } else if (modifiers == GDK_CONTROL_MASK && event->keyval == GDK_KEY_Tab) { overlay_show(info, OVERLAY_COMPLETION, true);