From 3245d671bb5b2c2d0156d6d9026742e26c2b49f6 Mon Sep 17 00:00:00 2001 From: Mihai Babiac Date: Fri, 29 Jul 2022 18:49:16 +0200 Subject: [PATCH] Add program_name to fix missing icons By default, GTK sets the prgname to argv[0], which is then used to choose the correct .desktop file. If the program is run through a symlink, such as through `/etc/alternatives/x-terminal-emulator`, argv[0] is not `terminator` so under Wayland the desktop file is not detected, leading to a missing icon. --- terminator | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/terminator b/terminator index 150fca0e..14fd9cf3 100755 --- a/terminator +++ b/terminator @@ -33,7 +33,7 @@ try: import gi gi.require_version('Gtk','3.0') # pylint: disable-msg=W0611 - from gi.repository import Gtk, Gdk + from gi.repository import Gtk, Gdk, GLib if Gdk.Display.get_default() == None: print('You need to run terminator in an X environment. ' \ @@ -80,6 +80,8 @@ if __name__ == '__main__': dbg ("%s starting up, version %s" % (APP_NAME, APP_VERSION)) + GLib.set_prgname(APP_NAME) + OPTIONS,dbus_options = terminatorlib.optionparse.parse_options() if OPTIONS.configjson: configjson = ConfigJson()