Crashes and won't start if autostart file is missing Icon line
- Tweaks 46.Beta
- Ubuntu 24.04 LTS
If an autostart file is missing the Icon line, GNOME Tweaks will crash and fail to start with this error:
Traceback (most recent call last):
File "/usr/bin/gnome-tweaks", line 99, in <module>
from gtweak.app import GnomeTweaks
File "/usr/lib/python3/dist-packages/gtweak/app.py", line 13, in <module>
from gtweak.tweakview import Window
File "/usr/lib/python3/dist-packages/gtweak/tweakview.py", line 20, in <module>
from gtweak.tweaks.tweak_group_startup import TWEAK_GROUP as StartupApplicationTweaks
File "/usr/lib/python3/dist-packages/gtweak/tweaks/tweak_group_startup.py", line 347, in <module>
TWEAK_GROUP = AutostartTweakGroup()
^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/gtweak/tweaks/tweak_group_startup.py", line 243, in __init__
self._setup_startup_app_row()
File "/usr/lib/python3/dist-packages/gtweak/tweaks/tweak_group_startup.py", line 269, in _setup_startup_app_row
app_row = _StartupAppRowTweak(dfile)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/gtweak/tweaks/tweak_group_startup.py", line 191, in __init__
app_icon = Gtk.Image.new_from_icon_name("image-missing", Gtk.IconSize.LARGE)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: Gtk.Image.new_from_icon_name() takes exactly 1 argument (2 given)
Test Case
Here is a sample file
~/.config/autostart/org.telegram.desktop.desktop
[Desktop Entry]
Type=Application
Name=org.telegram.desktop
Exec=flatpak run --command=telegram-desktop org.telegram.desktop -autostart
X-Flatpak=org.telegram.desktop
Workaround
Add a line like Icon=telegram
to that .desktop. It doesn't matter whether the icon name is even provided on your system.
Other Info
This was originally reported at https://launchpad.net/bugs/2056657