Menu Pipes in Fluxbox

How to do things, solutions, recipes, tutorials
Post Reply
Message
Author
User avatar
RSH
Posts: 2397
Joined: Mon 05 Sep 2011, 14:21
Location: Germany

Menu Pipes in Fluxbox

#1 Post by RSH »

Hi.

A search on the forum for Menu Pipes in Fluxbox did gave a result of two postings. Though I could not find any useful hints to this.

So I've made a little trial and error until I found a way to include a static build file containing code for the Fluxpup Menus.

Example for a static menu category:

Code: Select all

[submenu] (LazY FluX)
[exec] (Desktop-Laufwerks-Symbole) {eventmanager desktop}
[exec] (Desktop-Symbole) {lazy-icon_switcher}
[exec] (FlSynclient Touchpad ) {flsynclient}
[exec] (Fonts) {fontmanager}
[exec] (PupClockset) {PupClockset}
[end]
This has been saved as /root/.fluxbox/menu.add

Example for code to add to the file /root/.fluxbox/menu.base:

Code: Select all

   [separator]
   [include] (/root/.fluxbox/menu.add)
   [separator]
Attached Images shows the result after refrshing the menu.

To have a pipe -let's say for some scripts in /mnt/sda1/my-scripts- one just would need to write a little script that reads the directory /mnt/sda1/my-scripts and would echo its input (output of reading) in a modified form like this:

Code: Select all

[exec] (Menu-Title-here) {Path-and-Script-here}
That's all.

I'm using Menu Pipes heavily in my LazY Puppy builds, but almost used in Openbox, which uses real Menu Pipes, that are updated immediately when opening the Menu.

Currently I'm creating such feature for JWM in L.A.S.S.I.E., but statically like this one here, that needs to be updated manually. To have a static Menu Pipe to be updated manually is the way I do prefer now, since there is a lot of Scripts, RoxApps and PortableApps for Linux and Wine included in my external Application directories, so the real Openbox Menu Pipes do take sometimes 1 or 2 seconds to give access to the menu category.

Since the content of these directories doesn't change very often, it's not really needed to update those Menu Pipes each time when opening the Menu. That's why I prefer the "static-pipes" now.

However: atm I don't have any time to do any further work for Menu Pipes in Fluxpup, I decided to post this here. Maybe someone else is interested in this and might do some work for some scripts do make users able to create easily Menu Pipes for Fluxbox.

RSH
Attachments
image-2.jpg
(114.82 KiB) Downloaded 580 times
[b][url=http://lazy-puppy.weebly.com]LazY Puppy[/url][/b]
[b][url=http://rshs-dna.weebly.com]RSH's DNA[/url][/b]
[url=http://murga-linux.com/puppy/viewtopic.php?t=91422][b]SARA B.[/b][/url]

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#2 Post by musher0 »

Hello, RSH.

I do not use fluxbox, but from experience with the pekwm menu and
aewm menu (plus the usage by Mark Ulrich for fixmenus back in the day
and also adapting technosaurus/aragon's "simple puppy menu"), I agree
with you that static-pipes menus are the way to go.

As you mention, with dynamic menus, there is always a slight "hiccup"
or delay before the menu appears. This may not be a problem on fast,
recent PCs, but it is on older, slower machines. And of course this delay
is compounded, the more dynamic elements you have in your menu.

Following Mark Ulrich's lead, I found a way around this, by creating an
extra flag file in /usr/share/applications that stores the sum in bytes of
all *.desktop files. (You can of course create similar flag files for any
dynamic elements in the menu.)

So when you activate the menu, the script looks for these sum files. If
not changed, we go directly to the menu as it takes only a couple of
milliseconds to look-up this information. If changed, then the menu is
updated, and we have the usual delay. But of course, after our programs
have been installed in the Puppy, we very seldom have to change the
menu, so the "update menu" script is used only as needed, that is: barely.

I could include some script code as example, but I will not: :) because the
subject of this thread is fluxbox -- which I know nothing about.

My 2¢.

BFN.

musher0
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

Post Reply