Fluxbox: combining commands in a user menu
Tuesday, 6. January 2009, 07:20:10
I wouldn't have known about this unless I hadn't had a long IRC with a user called mark-t, who was helpful enough to finally give me the answer, but not so that he (or she, perhaps? Who can tell with the Internet?) wanted to tell anyone else.
SO...
The basic Fluxbox menu will probably not suit your needs, and it's a very easy thing to build your own. There is a basic guide at http://fluxbox-wiki.org/index.php?title=Editing_the_menu which tells you MOST of what you need to know.
What is not clear from the page is that there is a way to have more than one program started up at the same time; and also a way to have a toggled state.
The (much more complete) man page hints to this: it states that any legal key command can be used as a menu item. The difference (which is also not explained in the man page!) is that it has to be written in the form
[command {Exec program_1}...{Exec program_n}](label)
The two commands you might be interested in here are MacroCmd, which allows you start two processes one after another; and ToggleCmd, which gives you a switch (although you won't be able to see the state of the switch - maybe a Fluxbox wish?)
So, if I wanted to launch Psi and Opera at the same time, my menu entry would be
[MacroCmd {Exec psi} {Exec opera}](psi-opera-megasymbiotic-launcher)
And if I wanted to toggle JACK:
[ToggleCmd {Exec jackd} {Exec pkill jackd}] (Jack)
Simple really. Just not explained. Welcome to Linux!









How to use Quote function: