MATE and Python

Just wondering what parts of MATE are written in Python other than the advanced menu

For MATE upstream, the only Python parts are the extensions for caja and mozo (the menu editor).

In Ubuntu MATE specifically, things in Python are the HUD, the Advanced MATE Menu, the Nvidia Optimus applet, MATE Tweak, and the Software Boutique.

Aside from those there might be other third-party software included specifically with UM that might be Python, but the only thing that comes to mind is perhaps some additional caja extensions and a few extra panel applets.

I’m curious, why do you ask? :slight_smile:

Edit: I just remembered the MATE Dock Applet (which is third-party)

2 Likes

Just curious, gtk is usually written in C and that’s what’s in use in MATE, but is PyGtk usable instead?

I guess that will account for some inconsistency in the codebase, but an app can most certainly be written for MATE or UM…:neutral_face:

I’m interested in maybe trying to contribute through code eventually: I have started learning python before but never got very far and was not sure what all was written in python: I also do not really want to try learning C in my spare time and Python is the only other language that Ubuntu MATE uses to my knowledge (Maybe some C++?) and it is also a relatively easy language to learn from most of what I have read: and from the looks of it I possibly could still contribute to a sizable amount of the code used in UM without having to learn C: I possibly could also write applets and extensions once I was familiar with coding and that whole process

I hacked a bit on mate-optimus and it’s quite easy to get a hang of. For instance, you can quit that application via the GUI, and rerun a forked version from the command line, and it will behave as you might expect. It runs in the foreground and you can use print and pdb and whatnot. It might be a place to start if you want to play around; it’s very very simple.

You can write GTK apps more or less in any language. I will warn you, C is a very difficult language to do well. If you are leaning that way but aren’t already neck deep in it, take a look at Rust (from Mozilla) which gives you all the power of C but without the sharp edges. If you are looking for something that is more scriptish, Python would be a good choice. I haven’t played with it, but it looks like there is decent support for GTK in Node, so you could work with it either in JavaScript or Typescript pretty easily, if you already are familiar with that. Electron or NW.js make more sense for that ecosystem though. Looks like the support for GTK in Go is being kept current, and that is certainly good if you like the language. I would not recommend Java - libraries were out of date last time I looked.

Also, when you come up with your next great thing, consider this:

https://docs.snapcraft.io/build-snaps/

Free software is okay, but democratic software - that’s the future!

My plan is to use Python as I think I can learn enough of it on my own and several parts of UM already use Python so I can possibly help with the distro in addition to maybe creating new things

1 Like

@Apollonius - These days we use PyGObject, rather than PyGtk, which gives us a lot more access to the internals of GTK+.

@Bernie - I agree with your choice of using Python. It’s a solid language and well supported in MATE.

Language choice aside, a lot of the bindings for MATE libraries are written with C and Python in mind, so although you can write GTK+ apps in many languages, you might be out of luck when trying to integrate with MATE’s menu system or the panel components.

We’re moving a bunch of things to use gobject introspection for the 1.22 version of MATE, but even that is limited and not entirely ready yet. Once done, though, it would (in theory) allow us to have apps in any language with support for gobject-introspection to integrate fully with MATE.

3 Likes