Re: [LAU] Audio applications menu generation

From: James Morris <jwm.art.net@email-addr-hidden>
Date: Mon Jan 24 2011 - 00:25:53 EET

After some more work all menus are specified as BASH arrays within the script.

Here's the new version which also recognizes many more applications:
http://jwm-art.net/code/lau_flux_menu_0.0.1

Here's the obligatory screenshot:
http://jwm-art.net/code/lau_flux_menu_0.0.1.png

Here's the listing format for a menu:

MENU_ARRAY=(
    "command1, name"
    "--"
    "+submenu_file, name"
    "!fluxbox_command, name"
)

# notes:
# **** "--" creates a menu separator.
# **** the command should not be specified with path.
# **** whitespace must not be placed between command and comma.
# **** whitespace after the comma is removed.
# **** the * character must not be used.
# **** () in the name will be replaced with {} as
fluxbox can't handle ().

The menu generation is now a function which is called with four
parameters, like so:

create_menu "My Menu" ~/.fluxbox/my-menu-file MENU_ARRAY[@]

Which basically means all the menus generated by the script are easily
customizable so that my choices don't have to be your choices.

The script uses the 'which' command to figure out both if the command
exists on the system and the full path for the command.

The worst bug I know of it has is that while it can handle commands such as:
xterm -e alsamixer
jaaa -J

it cannot handle:

xterm -e sudo halt

Usage of xterm is hard coded at present. If the command begins with
"xterm -e" it performs the which command on the command after.

Cheers,
James.

-- 
_
: http://jwm-art.net/
-audio/image/text/code/
_______________________________________________
Linux-audio-user mailing list
Linux-audio-user@email-addr-hidden
http://lists.linuxaudio.org/listinfo/linux-audio-user
Received on Mon Jan 24 04:15:01 2011

This archive was generated by hypermail 2.1.8 : Mon Jan 24 2011 - 04:15:02 EET