Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix tray icon not showing up #8

Merged

Conversation

angrylinuxuser
Copy link

There is an issue with tray icon not showing up on wayland and x on gnome (for me - and some others Ryochan7#106 ?). This is the output of the scc gui

/usr/lib/python3.12/site-packages/scc/gui/statusicon.py:267: PyGIWarning: AppIndicator3 was imported without specifying a version first. Use gi.require_version('AppIndicator3', '0.1') before import to ensure that the right version gets loaded.
  from gi.repository import AppIndicator3 as appindicator
Traceback (most recent call last):
  File "/usr/lib/python3.12/site-packages/scc/gui/statusicon.py", line 315, in __init__
    self._status_gtk = StatusIconGTK3(*args, **kwargs)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/scc/gui/statusicon.py", line 209, in __init__
    raise NotImplementedError
NotImplementedError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.12/site-packages/scc/gui/app.py", line 1364, in do_startup
    self.setup_statusicon()
  File "/usr/lib/python3.12/site-packages/scc/gui/app.py", line 279, in setup_statusicon
    self.statusicon = get_status_icon(self.imagepath, menu)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/scc/gui/statusicon.py", line 422, in get_status_icon
    return StatusIconProxy(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/scc/gui/statusicon.py", line 323, in __init__
    self._load_fallback()
  File "/usr/lib/python3.12/site-packages/scc/gui/statusicon.py", line 354, in _load_fallback
    self._status_fb.connect(b"clicked", self._on_click)
TypeError: GObject.connect() argument 1 must be str, not bytes

I don't know python besides some basic stuff but this change fixes the issue for me. Please check if it's correct.

Good luck with this fork!

@chewi
Copy link

chewi commented Aug 15, 2024

That fixes this error for me.

Traceback (most recent call last):
  File "/usr/lib/python3.12/site-packages/scc/gui/statusicon.py", line 336, in _on_notify_active_gtk
    self._load_fallback()
  File "/usr/lib/python3.12/site-packages/scc/gui/statusicon.py", line 353, in _load_fallback
    self._status_fb.connect(b"clicked",        self._on_click)
TypeError: GObject.connect() argument 1 must be str, not bytes

It still doesn't work here on Gentoo though because libappindicator has been dropped.

W StatusIcon    Failed to import AppIndicator3
W StatusIcon    StatusIcon: Using backend StatusIconDummy (fallback)

libayatana-appindicator is the thing to use now.

@chewi
Copy link

chewi commented Aug 15, 2024

See #9 about that.

@C0rn3j
Copy link
Owner

C0rn3j commented Aug 21, 2024

Thanks for the fix.

@C0rn3j C0rn3j merged commit d096f91 into C0rn3j:python3 Aug 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants