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

AttributeError: 'gi.repository.Gtk' object has no attribute 'StatusIcon' #2

Open
mxmilkiib opened this issue Sep 22, 2021 · 2 comments

Comments

@mxmilkiib
Copy link

Trying on Arch atm;

/home/milk/src/brightnessicon/./brightnessicon:2: PyGIWarning: Gtk was imported without specifying a version first. Use gi.require_version('Gtk', '4.0') before import to ensure that the right version gets loaded.
  from gi.repository import Gtk, Gdk
Traceback (most recent call last):
  File "/home/milk/src/brightnessicon/./brightnessicon", line 121, in <module>
    tray = Tray (o)
  File "/home/milk/src/brightnessicon/./brightnessicon", line 35, in __init__
    self.icon = Gtk.StatusIcon.new_from_file ("/usr/share/brightnessicon/icon.svg")
  File "/usr/lib/python3.9/site-packages/gi/overrides/__init__.py", line 32, in __getattr__
    return getattr(self._introspection_module, name)
  File "/usr/lib/python3.9/site-packages/gi/module.py", line 123, in __getattr__
    raise AttributeError("%r object has no attribute %r" % (
AttributeError: 'gi.repository.Gtk' object has no attribute 'StatusIcon'
@pmrv
Copy link
Owner

pmrv commented Sep 23, 2021

What version of the gtk3 package are you on? I've just tried installing it with 1:3.24.30+62+g8d04980f38-2 and it works. I just read that Gtk.StatusIcon is deprecated and gtk3 and removed in gtk4, so if you're already on gtk4 this might be the problem.

@pmrv
Copy link
Owner

pmrv commented Sep 23, 2021

Btw. to make sure you have the deps in your arch install with the provided PKGBUILD, i.e. copy it somewhere and then run makepkg -si, instead of running the script directly.

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

No branches or pull requests

2 participants