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-toolsudo apt install gnome-tweak-toolsudo apt install gnome-tweak-tool
Enter fullscreen mode Exit fullscreen mode
Create the gnome plugin
Then open a terminal (Ctrl+Alt+T) and type this
cd ~/.config/argosnano launcher.pycd ~/.config/argos nano launcher.pycd ~/.config/argos nano launcher.py
Enter fullscreen mode Exit fullscreen mode
or any other editor.
Paste the Python code below.
#!/usr/bin/env pythonimport refrom gi.repository import Gioprint("Python | iconName=starred")print("---")print("Gedit | iconName=gedit bash=gedit terminal=false")print("Nautilus | iconName=system-file-manager bash=nautilus terminal=false")print("---")#!/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("---")#!/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("---")
Enter fullscreen mode Exit fullscreen mode
Save and close. Then type
chmod +x launcher.pychmod +x launcher.pychmod +x launcher.py
Enter fullscreen mode Exit fullscreen mode
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
暂无评论内容