diff --git a/config.h b/config.h index f3e1bcb..71f8b92 100644 --- a/config.h +++ b/config.h @@ -1,5 +1,4 @@ #define CLICKABLE_URL -//#define ICON_NAME "terminal" static const char *url_regex = "(ftp|http)s?://[-a-zA-Z0-9.?$%&/=_~#.,:;+]*"; diff --git a/termite.c b/termite.c index 9300b65..380f655 100644 --- a/termite.c +++ b/termite.c @@ -320,6 +320,12 @@ static void load_config(GtkWindow *window, VteTerminal *vte, gboolean *dynamic_t } g_free(cursor_shape); } + + gchar *icon_name = g_key_file_get_string(config, "options", "icon_name", &error); + IGNORE_ON_ERROR(error) { + gtk_window_set_icon_name(window, icon_name); + g_free(icon_name); + } } g_key_file_free(config); } @@ -348,13 +354,6 @@ int main(int argc, char **argv) { gtk_window_set_role(GTK_WINDOW(window), role); } -#ifdef ICON_NAME - GdkPixbuf *icon = gtk_icon_theme_load_icon(gtk_icon_theme_get_default(), ICON_NAME, 48, 0, NULL); - if (icon) { - gtk_window_set_icon(GTK_WINDOW(window), icon); - } -#endif - GtkWidget *overlay = gtk_overlay_new(); GtkWidget *vte = vte_terminal_new(); diff --git a/termite.cfg b/termite.cfg index b536028..2d1a556 100644 --- a/termite.cfg +++ b/termite.cfg @@ -9,6 +9,7 @@ dynamic_title = true urgent_on_bell = true font = Monospace 9 scrollback_lines = 1000 +#icon_name = terminal # SYSTEM, ON or OFF cursor_blink = SYSTEM