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.
This commit is contained in:
Mihai Babiac 2022-07-29 18:49:16 +02:00
parent 7b39058b0e
commit 3245d671bb
1 changed files with 3 additions and 1 deletions

View File

@ -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()