sillysloft / fluxbox

Fluxbox Window Manager (Mirror)
http://fluxbox.org/news/
Other
0 stars 1 forks source link

fbgm doesn't generate submenus properly #538

Open sillysloft opened 19 years ago

sillysloft commented 19 years ago

FBGM in this version:

Fluxbox version: 0.9.14-gentoo-r1 Compiled: Oct 22 2005 23:38:45 Compiler: GCC Compiler version: 3.3.6 (Gentoo 3.3.6, ssp-3.3.6-1.0, pie-8.7.8)

Defaults: menu: /usr/share/fluxbox/menu style: /usr/share/fluxbox/styles/Clean keys: /usr/share/fluxbox/keys init: /usr/share/fluxbox/init nls: /usr/share/fluxbox/nls

Compiled options (- => disabled): -DEBUG SLIT TOOLBAR XPM IMLIB2 GNOME KDE EWMH REMEMBER SHAPE XFT XMB -XINERAMA RENDER

improperly generates submenus in the ~/.fluxbox/menu file:

[submenu] (Net) [submenu] (Browsers) c (firefox) {firefox} c (links-graphic) {links -driver x fluxbox.org} c (opera) {env QT_XFT=true opera} c (konqueror) {kfmclient openProfile webbrowsing} c (links) {xterm -e links fluxbox.org} c (lynx) {xterm -e lynx fluxbox.org}

..etc. If i change "c" to "[exec]", the menu works again.

Reported by: t35t0r

sillysloft commented 19 years ago

Logged In: YES user_id=1300277

$ bash --version GNU bash, version 3.00.16(1)-release (i686-pc-linux-gnu)

$ find_it () { which $1 > /dev/null 2>&1 && shift && $*; } $ normal_find () { while [ "$1" ]; do find_it $1 echo "[exec] ($1) {$1}"; shift; done; } $ normal_find firefox c (firefox) {firefox}

Original comment by: t35t0r

sillysloft commented 19 years ago

Logged In: YES user_id=1300277

lrwxrwxrwx 1 root root 4 Oct 17 23:34 /bin/sh -> bash

[I--] [ ] app-shells/bash-3.0-r13 (0)

here's a strange fix basically change all references to "[exec]" in FBGM to "[exec ]" (not the space between the "c" and the "]").

gvim /usr/bin/fluxbox-generate_menu :1,$ s/\[exec\]/\[exec \]/g

now run fluxbox-generate_menu and instead of seeing this:

c (firefox) {firefox}

you'll see

[exec ] (firefox) {firefox}

which fluxbox can parse just fine so the submenu's work again!

Original comment by: t35t0r

sillysloft commented 19 years ago

Logged In: YES user_id=1300277

I've figured out the problem in a little bit more detail. In my home directory I have a directory called "c". For some reason in that echo statement, echo "[exec]..." it is globbing [exec] into a set that looks for the characters "e", "x", or "c" in the path. Since the directory "c" is in the path (my home directory) it outputs "c" since it was found.

Now for any bash gurus out there, why is it doing this? I mean the command: echo * displays everything in the `pwd` but the command echo "*" displays '*' so why is that echo globbing "[exec]" into [exec]?

Original comment by: t35t0r

sillysloft commented 19 years ago

Logged In: YES user_id=1300277

Here's a possible fix:

find_it () { which $1 > /dev/null 2>&1 && shift && "$@"; }

note the "$*" changed to " "$@" " and keep the same normal_find function:

normal_find () { while [ "$1" ]; do find_it $1 echo "[exec] ($1) {$1}"; shift; done; }

now "normal_find firefox" gives:

[exec] (firefox) {firefox}

Original comment by: t35t0r

sillysloft commented 19 years ago

fix for fluxbox-generate_menu described in comment Date: 2005-10-23 00:40

Original comment by: t35t0r

sillysloft commented 19 years ago

Original comment by: akir

sillysloft commented 19 years ago

Logged In: YES user_id=1101187

fixed in 4129, thanx

Original comment by: akir