Hi all,
I’ve been messing around with FVWM for a while now and I felt I should try something a bit more interesting with my configuration.
One feature I’ve noticed missing from FVWM is the ability to bind icons/buttons/text to executable bits of FVWM code. An example will illustrate what I mean here.
When you add a menu item to a menu, you can choose to associate an icon with the item, as well as a menu label. When you create a launcher bar with FvwmButtons, you can specify which icon to use on the button. Windows can also have mini-icons associated with them, which are used in the window itself, and the taskbar.
Wouldn’t it be nice to use the same icon in all cases automatically? Right now you have to keep track of this manually. To help with this, I’m attempting to implement what I’m calling an “action” system in FVWM. I would like to use Lisp, but that’s beside the point.
An FVWM Action would have the following properties:
-
a unique identifier.
-
an FVWM function to execute.
-
(optional) window id, if the action has an associated window.
-
(optional) a mini-icon, to be used in menus and buttonbar launchers. If the action has an associated window (i.e. the window id property is defined), then the icon is used as the app’s mini-icon and the app’s icon on the taskbar as well.
-
(optional) menu text, if you want this action to appear on a menu.
-
(optional) a keybinding, for executing the action with a keystroke.
A few months ago, I did implement something primitive along these lines. The result was a collection of Lisp scripts executed at FVWM startup. It worked (more or less) but it was kind of static; you couldn’t really change anything after startup. I would like to try something a bit more dynamic.
So I’d like to ask some advice on how to go about doing this. Obviously, an “action” is an abstract concept that does not exist in FVWM, so the concept will have to be implemented externally. Should there be something separately “running”, like a module, which knows how to translate “action” commands to FVWM commands? Actions could be loaded into memory and FVWM could run queries on it, I guess, when it needed to (like when it needed to populate a menu entry).
Or should the system be stored entirely on disk, fronted by a bunch of scripts that FVWM uses via PipeRead?
I can think of pros and cons for both. The former is, I imagine, faster, for the same reason that mod_perl is faster than CGI: you save the overhead of loading and compiling the scripts (in the case of Perl and Lisp), everytime you want to use them. On the other hand, I would imagine that the latter approach is somewhat easier.
Any thoughts?
Desmond