Skip to content
This repository was archived by the owner on Feb 25, 2021. It is now read-only.

Cannot add to panel #11

Closed
bashfulrobot opened this issue Oct 19, 2018 · 14 comments
Closed

Cannot add to panel #11

bashfulrobot opened this issue Oct 19, 2018 · 14 comments

Comments

@bashfulrobot
Copy link

Hi there,
I was following along with the instructions posted, but for some reason when I press the add button, nothing happens. I cannot add the applet to the panel.

Ideas?

@bashfulrobot
Copy link
Author

Sorry - additional details...

Version Info

$ cat /etc/lsb-release 
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=18.04
DISTRIB_CODENAME=bionic
DISTRIB_DESCRIPTION="Ubuntu 18.04.1 LTS"
#
$ mate-about --version
MATE Desktop Environment 1.20.1
#
$ i3 --version
i3 version 4.14.1 (2017-09-24) © 2009 Michael Stapelberg and contributors

Potential Error?

This may or may not be intended to be run like this, but just in case:

$ /usr/lib/mate-i3-applet/matei3applet.py
/usr/lib/python3/dist-packages/gi/overrides/Gtk.py:48: RuntimeWarning: You have imported the Gtk 2.0 module.  Because Gtk 2.0 was not designed for use with introspection some of the interfaces and API will fail.  As such this is not supported by the pygobject development team and we encourage you to port your app to Gtk 3 or greater. PyGTK is the recomended python module to use with Gtk 2.0

Thank you.

@city41
Copy link
Owner

city41 commented Oct 19, 2018

Did you grab the 1.1.1 release? The version of mate-i3-applet you are using is trying to load Gtk 2.0, which suggests it's an older version. That won't work with recent versions of MATE as they've switched to Gtk 3.0.

I would expect 1.1.1 to work, as it defaults to Gtk 3.0.

If it still doesn't work, can you edit log.py and set SHOULD_LOG to true, try to add the applet, then send the contents of ~/.matei3applet.log
Also can you do tail /var/log/syslog | grep mate

(I realize this is a pretty primitive logging/debugging approach. I honestly don't know much about MATE, was hoping by open sourcing this I'd get some support there, but alas MATE applets seem to be super obscure :))

@landmaj
Copy link
Contributor

landmaj commented Oct 21, 2018

I have exactly the same version of Ubuntu, MATE and i3 as @bashfulrobot and it works fine for me. However when I installed 18.10 it failed as described and the error message said that GTK3 is required by the application but GTK2 was already loaded.

I gave up quickly because Ubuntu Mate 18.10 is broken anyway (at least minimal installation) and apt autoremove breaks the system.

@city41
Copy link
Owner

city41 commented Oct 21, 2018

Interesting, I've not tried 18.10. I also run Ubuntu 18.04 with MATE 1.20.1 and the applet works without issue. I still wonder if @bashfulrobot grabbed an older version.

Thanks for the heads up on 18.10.

@landmaj
Copy link
Contributor

landmaj commented Oct 22, 2018

BTW since I use this applet all the time (at home and at work) I wanted to help you with it's development. Visual side of code could use some improvements (PyCharm is all yellow when I open this repository) and I would start with that. Working with beautiful (and pythonic) code is much more pleasant. Logging is implemented strangely so I would also fix that, especially since I want to find the reason why this applet doesn't work on the newest Ubuntu.

But before I commit my time I would like to know if you want that kind of help to begin with.

@city41
Copy link
Owner

city41 commented Oct 22, 2018

Yeah, code clean up is appreciated. This is the only Python program I've ever written, so I don't know the language too well.

@bashfulrobot
Copy link
Author

Did you grab the 1.1.1 release? The version of mate-i3-applet you are using is trying to load Gtk 2.0, which suggests it's an older version. That won't work with recent versions of MATE as they've switched to Gtk 3.0.

I would expect 1.1.1 to work, as it defaults to Gtk 3.0.

If it still doesn't work, can you edit log.py and set SHOULD_LOG to true, try to add the applet, then send the contents of ~/.matei3applet.log
Also can you do tail /var/log/syslog | grep mate

(I realize this is a pretty primitive logging/debugging approach. I honestly don't know much about MATE, was hoping by open sourcing this I'd get some support there, but alas MATE applets seem to be super obscure :))

According to my folder structure (/home/dustin/tmp/mate-i3-applet-1.1.1) I am using v1.1.1.

I'll try your suggestions when I get back post meeting. Appreciated.

@bashfulrobot
Copy link
Author

If it still doesn't work, can you edit log.py and set SHOULD_LOG to true, try to add the applet, then send the contents of ~/.matei3applet.log
Also can you do tail /var/log/syslog | grep mate

I added the logging and ran the applet manually, but no file was created. So I just tailed the syslog as suggested. I am attaching (file) the output.

Thank you for your help.
mate-error.txt

@city41
Copy link
Owner

city41 commented Oct 22, 2018

This looks to be the issue: ImportError: Requiring namespace 'Gtk' version '3.0', but '2.0' is already loaded

I was under the impression from MATE 1.18.0 on, Gtk 2 was no longer in the picture. That doesn't seem to be the case for you.

Can you try changing this line back to 2.0 and see what you get?
https://github.com/city41/mate-i3-applet/blob/master/matei3applet.py#L4

I'm a bit out of my depth here, there's so little info on MATE applets on the web (especially for recent versions of MATE) that I'm not sure where to begin.

@city41
Copy link
Owner

city41 commented Oct 23, 2018

This applet does not specify the version of MatePanelApplet to load, but mate-i3-applet specifies version 4.0:

https://github.com/mate-desktop/mate-university/blob/master/applet-python/university-python-applet

@landmaj
Copy link
Contributor

landmaj commented Oct 25, 2018

I figured why it didn't work - latest tagged release is from August 12 (1.1.1), however the switch from GTK2 to GTK3 was made on August 17 (a695b04). On the same day, README.md was updated to reflect the change, but the recommended way to install still directs to the outdated release that supports GTK2 by default. I must have downloaded 1.1.1 release when I installed Ubuntu 18.10, however on 18.04 I actually just cloned master branch so it worked.

It should be quite easy to detect Mate version and import the correct GTK version based on that. I'm short on time right now but I will try it this weekend.

@city41
Copy link
Owner

city41 commented Oct 26, 2018

🤦‍♂️ doh, I screwed that one up. Ok, I think that explains everything. Thanks for the sleuthing @landmaj

@bashfulrobot I think your issue is the applet is loading Gtk 2.0, then MatePanelApplet wants 3.0, and so it bombs out. Due to me accidentally making 1.1.1 still be based on 2.0, I got confused somewhere along the way.

I will do a 1.1.2 release now.

@landmaj detecting MATE version then picking 2.0 or 3.0 is not a bad idea. Although it might also still be fine to just support 3.0 going forward as I originally intended.

@city41
Copy link
Owner

city41 commented Oct 26, 2018

ok 2.0.0 is out. @bashfulrobot please try it and let me know how it goes.

@city41
Copy link
Owner

city41 commented Oct 29, 2018

fixed in 2.1.0

@city41 city41 closed this as completed Oct 29, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants