Xfce Forum

Sub domains
 

You are not logged in.

#1 2023-11-20 20:16:00

chang-zhao
Member
Registered: 2023-11-20
Posts: 38

vervie - new XFCE panel extension written in Python

This program was inspired by "verve" XFCE plugin, that allows to drag-drop or enter some text, and then do a limited number of actions with that text, e.g. look it up in the internet.

Here I present Vervie ("rope" in Russian) that lets you "pull" unlimited amount of actions to perform with the entered text. (That's the advantage of Vervie over Verve).

It also solves the problem that XFCE launchers accept only files and URIs to be drag-dropped, but not arbitrary text lines. Vervie accepts any text, files or URIs. (That's the advantage of Vervie over standard XFCE launchers).

vervie

Vervie:

* Accepts arbitrary text (to be drag-dropped, pasted or entered), as well as drag-dropped files and URIs.
* Automatically opens a popup panel with any number of buttons.

You will have to edit settings according to your needs, as it might not quite work out of the box.

Still it can be useful for many people, so I decided to share it with you.

It's GTK-3 + Python text entry with popup panel. It's a standalone program, not an XFCE plugin, because making it a plugin would require some C functions for the plugin to get focus, and I'm too rusty (or too lazy) to write in C.

https://codeberg.org/chang-zhao/vervie

Offline

#2 2023-11-21 17:01:52

bunnymnemonic
Member
Registered: 2018-01-03
Posts: 16

Re: vervie - new XFCE panel extension written in Python

That is really a nice program, I like how customizable it is. Thank you very much!

EDIT: I cannot set the entry width and height.
There might be something with the Python GTK library? I get this message in the Terminal:

CTraceback (most recent call last):
  File "/home/simon/Letöltések/vervie/vervie", line 464, in <module>
    Gtk.main()
  File "/usr/lib/python3/dist-packages/gi/overrides/Gtk.py", line 1687, in main
    with register_sigint_fallback(Gtk.main_quit):
  File "/usr/lib/python3.10/contextlib.py", line 142, in __exit__
    next(self.gen)
  File "/usr/lib/python3/dist-packages/gi/_ossighelper.py", line 237, in register_sigint_fallback
    signal.default_int_handler(signal.SIGINT, None)

Last edited by bunnymnemonic (2023-11-21 17:21:55)

Offline

#3 2023-11-21 18:05:07

chang-zhao
Member
Registered: 2023-11-20
Posts: 38

Re: vervie - new XFCE panel extension written in Python

bunnymnemonic wrote:

That is really a nice program, I like how customizable it is. Thank you very much!

EDIT: I cannot set the entry width and height.
There might be something with the Python GTK library? I get this message in the Terminal:

CTraceback (most recent call last):
  File "/home/simon/Letöltések/vervie/vervie", line 464, in <module>
    Gtk.main()
  File "/usr/lib/python3/dist-packages/gi/overrides/Gtk.py", line 1687, in main
    with register_sigint_fallback(Gtk.main_quit):
  File "/usr/lib/python3.10/contextlib.py", line 142, in __exit__
    next(self.gen)
  File "/usr/lib/python3/dist-packages/gi/_ossighelper.py", line 237, in register_sigint_fallback
    signal.default_int_handler(signal.SIGINT, None)

Probably some libraries are missing. Maybe you need python-xlib? It's probably used by Gdk to work with windows:

https://lazka.github.io/pgi-docs/#GdkX11-4.0

(I assune you already have gtk3 and gobject-introspection?)

When I run

  pip list

it lists many packages including

pycairo             1.25.1
PyGObject           3.46.0
PyOpenGL            3.1.6
python-xlib         0.33

It's hard to figure out which ones are necessary to install. Try something like

  pacman -S python-xlib

If you manage to get it working, please post the solution here, so I could correct the documentation.

Thank you. smile

PS. Also see requirements /installation for various distros (except that use gtk3 instead of gtk4):

https://pygobject.readthedocs.io/en/lat … arted.html

I hope it will help.

Last edited by chang-zhao (2023-11-21 18:19:35)

Offline

#4 2023-11-21 18:47:32

bunnymnemonic
Member
Registered: 2018-01-03
Posts: 16

Re: vervie - new XFCE panel extension written in Python

Hi,
Thank you very much for your answer!
I noticed that these lines (line 417 and 418) are commented out in the vervie file (which is available in the Codeberg repository):
        #if hasattr(conf, 'w') and hasattr(conf, 'h'):
        #    self.resize(conf.w, conf.h)

I deleted the # characters and now it works!
Thank you!

Offline

#5 2023-11-21 19:49:43

chang-zhao
Member
Registered: 2023-11-20
Posts: 38

Re: vervie - new XFCE panel extension written in Python

bunnymnemonic wrote:

Hi,
Thank you very much for your answer!
I noticed that these lines (line 417 and 418) are commented out in the vervie file (which is available in the Codeberg repository):
        #if hasattr(conf, 'w') and hasattr(conf, 'h'):
        #    self.resize(conf.w, conf.h)

I deleted the # characters and now it works!
Thank you!

Oh... Thank you!
(Going to correct it now...)

Offline

#6 2023-11-26 03:01:26

chang-zhao
Member
Registered: 2023-11-20
Posts: 38

Re: vervie - new XFCE panel extension written in Python

Just a heads up:
there was a problem if the argument line contained parentheses for example
https://codeberg.org/chang-zhao/vervie/issues/1
Now I changed `join` to `.format()` and added single quotes. It should work properly. The command line format in `conf.py` changes of course. Instead of `command ` it will be `command {}`.

Offline

Board footer

Powered by FluxBB