Re: FVWM: howto conditionally add menu entries?
Stefan Blachmann <[email protected]>
| Newsgroups | gmane.comp.window-managers.fvwm |
|---|---|
| Message-ID | <CACc-My18O1UbuR3cgZE2sw6i6w3j3hrKcidkD3fU6WM_p7oiuA@mail.gmail.com> |
On 8/3/19, hw <[email protected]> wrote: > Dan Espen <[email protected]> writes: >> Try PipeRead. Use shell, Perl, Python, your choice. > > How would that work? I'm trying to make a kinda dynamic configuration, > meaning that there is supposed to be a basic configuration accompanied > by optional configurations. [...] > If I was to write some program to create the root menu, I would always > need to modify the program when new optional configurations are to be > added so it could recognize them. That is something I would prefer to > avoid. [...] > Unfortunately, that raises the question how I can make it so that the > entries in the root menu appear in a desired order and with the title at > the top rather than somewhere in between the entries ... Is there a way > to sort menu entries once no more entries are being added? > > I'm probably not the first one to try this. It can't be this difficult, > can it? I have long thought about menu stuff, too. What I wanted for me is a menu that allows me to browse apps and files, the latter also categorywise (i.e. all, or only text/graphics/multimedia, or on extension). And this menu must include recent accesses nicely presented, so one does not need to search for long. Kind of self-sorting menus that do not make the need of sorting arise. Imho PipeRead and some script language is the way to go. You can look at what I use on https://github.com/kernschmelze/meowpurr. Actually two programs, <meow.pl> reads the .desktop files' information and is usually started once FVWM starts up, <purr.pl> does the menu generation when called by PipeRead. It is still WIP - the integration/merging of the Freedesktop Recent file/URL data is still in progress - and there are some small bugs ofc. When I got time I also will add the MenuColor directive that @ThomasAdam recently implemented (big kudos to Thomas!) So if you want to see how to dynamically generate complex nested menu structures, maybe take a look at that, or even give it a try. You might like Its self-sorting features, which it adapts depending on your usage.