I have been diving into customizing my GNOME setup lately & I want to know what is the best way to use Python for tweaking or automating things? I know GNOME has a strong ecosystem with extensions and settings you can tweak but I want to hear from others who have used Python to enhance their experience.
Are there any good libraries or APIs for interacting with GNOME settings, extensions or even Nautilus? I came across gi.repository but was not sure if that is the best way to go about it. I would like to automate some tasks, maybe tweak the UI a bit or even build a small script for workflow improvements.
Also; while exploring different use cases, I came across some python interview ques related to automation and scripting—some of them actually helped me understand how Python can be used in real-world scenarios. I want to know if anyone here has used similar concepts for customizing GNOME.
That’s an awfully broad and generic question, to which you most likely won’t find a good answer, if you ask me…
AFAIK gi.repository simply contains the bindings for GLib and GObject based libraries, like GTK. This is part of the PyGObject project, which you can find here:
The Gnome Shell and its extensions use GJS, a JavaScript engine, so using Python would require some effort.
You can extend Nautilus with Python though, using the nautilus-python extension. You can also write applications in Python using PyGObject bindings and GTK.
And of course, you could write scripts that call functionality over DBus, etc…
To be honest, I think asking “what could I do with Python in GNOME” is a very difficult question because of its broad scope, to which the only simple answer is “a lot”.
Likewise, when asking “are there cool projects for GNOME in Python”, the simple answer is “a lot”. There are tons of GTK apps using Python, like Lollypop or Refine, there are Nautilus extensions, probably a lot of scripts as well.
So yeah, you ask a broad question, you get a broad answer.