You can create Gnome 3.x plugins straight from Python. Of course, you should know Python programming. It's not that hard to do. Great! how do you create a plugin?
Do you use/like Gnome desktop? It's the default desktop on many Linux distros like Ubuntu, Debian, OpenSuse and others.
It's this one:
The setup
It takes some setup before you can run Python script on the gnome desktop. I've tested this on then newest gnome desktop, it may not work for classic gnome desktop (mate).
Setup the argos plugin and enable it using gnome tweak tool.
Click extensions and enable argos. If you don't have tweak tool, run this command
sudo apt install gnome-tweak-tool
Create the gnome plugin
Then open a terminal (Ctrl+Alt+T) and type this
cd ~/.config/argos
nano launcher.py
or any other editor.
Paste the Python code below.
#!/usr/bin/env python
import re
from gi.repository import Gio
print("Python | iconName=starred")
print("---")
print("Gedit | iconName=gedit bash=gedit terminal=false")
print("Nautilus | iconName=system-file-manager bash=nautilus terminal=false")
print("---")
Save and close. Then type
chmod +x launcher.py
You should now see the Python script output in your tool bar. The plugin argos will scan the directory ~/.config/argos constantly for changes.
Any file you place in there is a plugin.
Related links
Top comments (1)
Hi!
Thank you for your post.
I love to learn how can I make extensions for ubuntu
but I've got some problems.
when I click on the python button in my top bar , it doesn't do anything.
what shall I do?
and I have ubuntu 20.04