Closed BabuShenoy closed 4 years ago
whereas I can't find pygobject2.
The imports will run before the definition of WindowManager
, so the error you posted means that you've already got pygobject 2.x installed. I'm going to assume that SUSE pulled it in as a dependency for PyGTK as Debian/Ubuntu/Mint do.
(In fact, I'm not sure whether you need to explicitly specify it on Fedora either. Those dnf
commands are user-contributed.)
Given that the SUSE names seem more similar to the Debian/Ubuntu/Mint names than the Fedora ones, you probably saw it get installed under a name like python-gobject-2
.
wnck.WINDOW_CHANGE_WIDTH | wnck.WINDOW_CHANGE_HEIGHT):
AttributeError: 'module' object has no attribute 'WINDOW_CHANGE_X'
You're the third person to encounter that problem and it's actually covered in the FAQ.
TL;DR: Either you're running an ancient version of libwnck or your distro maintainer forgot to rebuild python-wnck
when they upgraded libwnck
and, as such, the bindings don't provide access to the entire contents of the library. Report the problem and, if you can't wait, rebuild the bindings from source.
Let me know once the distro-provided package is updated and I'll happily add a command for SUSE to the install instructions. (I'll leave this open as a TODO note for that.)
EDIT: I've gotta pay more attention when a GitHub e-mail arrives while I'm using a BBCode-based forum. This is the third time in a month that I've had to edit a post from BBCode to Markdown after posting.
As I'm not a computer engineer, I fear I didn't understand much of your explanation. What I have done has been to download further packages that might seem related to the ones listed in your instructions, using the YaST tool of OpenSUSE.
This is the error message that I'm getting now:
$ ./quicktile.py * (quicktile.py:17467): WARNING : Trying to register gtype 'WnckWindowState' as enum when in fact it is of type 'GFlags' * (quicktile.py:17467): WARNING _: Trying to register gtype 'WnckWindowActions' as enum when in fact it is of type 'GFlags' _ (quicktile.py:17467): WARNING **: Trying to register gtype 'WnckWindowMoveResizeMask' as enum when in fact it is of type 'GFlags' Traceback (most recent call last): File "./quicktile.py", line 422, in
class WindowManager(object): File "./quicktile.py", line 657, in WindowManager wnck.WINDOW_CHANGE_WIDTH | wnck.WINDOW_CHANGE_HEIGHT): AttributeError: 'module' object has no attribute 'WINDOW_CHANGE_X'
In the FAQ you quoted it's written:
your Python bindings for libwnck are broken and you need to report the problem on your distro's issue tracker. (Specifically, the bindings were built against a copy of libwnck with a different ABI than the one you're trying to use them with.) While you wait for them to fix it, you should be able to solve the issue yourself by rebuilding the bindings from source.
What does it mean exactly to
rebuild the bindings from source ?
Most of your Linux desktop, including libwnck, is written in C, a human-readable programming language which must be "compiled" (translated) into machine-readable code before the computer can run it. The human-readable form of a program is called "source code" or "source" for short.
QuickTile is written in Python because it already spends 99% of its time just waiting for input and, while C gives you performance, it's very easy to make mistakes (which introduce bugs) and it requires you to be more verbose in your instructions.
Because they're written in different languages, you need a little bit of code which acts as an adapter between them. (python-wnck
, the "bindings")
Because libwnck
and python-wnck
are written in C, their form becomes fixed when the compiler runs, so things go wrong if the compiler is looking at an old version of libwnck
when it's building python-wnck
and then you try to use that python-wnck
machine code with a newer version of libwnck
that has different characteristics.
"Rebuild the bindings from source" means "download the version of python-wnck that programmers can edit, then run the compiler to make a new version of the machine code while the compiler is looking at the right version of libwnck
".
However, given your inexperience, I'm not sure whether I'd recommend it since I have no experience with RPM-based distros and, as such, I don't know how to walk you through building an RPM package. (Just installing is easy and I can walk you through that... but the proper way is to build an RPM package and give it to DNF to install so it knows how to uninstall it again if something goes wrong or you want to upgrade it.)
Thanks for your excellent explanation! In fact, it's true, I'm not sure how I could implement them concretely. I've published a similar post in the OpenSUSE forum, so as to understand how certain Gnome 3 settings might be used to get the same kind of results I have with Quicktile with Linux Mint: https://forums.opensuse.org/showthread.php/517038-How-to-tile-windows-on-NE-NW-SE-SW-corners-in-Gnome-3 I'm now posting there a link to this discussion of ours, so that OpenSUSE experts may see if there's any way to get your program work even with that distro. Maybe someone might like to create the required RPM packages.
I'm going to close this issue since there's now a GTK 3 port in the gtk3_port
branch preparing to be merged into master
. (It just needs a little more work on the new Sphinx docs and fixes for regressions #107 and #108.)
https://github.com/ssokolow/quicktile/tree/gtk3_port
(Just don't use the pip3
URL install method from the README. The URL it gives will point to the GTK+ 2.x version until the branch gets merged into master
.)
However, closed or not, I'd welcome an OpenSUSE equivalent to the APT and DNF commands in the README for installing dependencies under Debian and Fedora derivatives, repsectively.
Compliments for Quicktile! I've used it for quite some time on Linux Mint and I really adore it!
I've now installed OpenSuse Leap 42.1, but unfortunately I can't find some of the packages required by your program.
I obviously have python, whereas «'python-gtk' providing 'pygtk2' is already installed»
I have installed without problems python-xlib (you suggested it in relation to Debian derivatives, but I find it also in the OpenSuse repository), whereas I can't find pygobject2.
I cannot even get dbus-python, but I could install dbus-1-python
Finally, I dind't find gnome-python2-libwnck, but I could install python-wnck.
When I try to run quicktile.py (obviously after making executable), I get:
Can you give me any suggestion? I'd really like to use Quicktile even on this new distro.
Cheers!