X and Fluxbox :: restart_fluxbox with a keymapping



Thnx for the script, will use it when i need to rewrite the menu (all the important icons are already in place right now). If got 32x32 pix icons (.xtdesktop) and 48x48 pix icons (Suse) so i added: menu.itemHeight: 32 (which makes the icons look great, but the menu itself becomes very large). Funny thing is: when i decreased  the fontsize (from 200 to 50) , the fonts actualy became bigger/humongous actualy!)

! ***** fonts *****
*.font: -*-lucida-small-r-*-*-*-200-*-*-*-*-*



:cool:

You may be trying a font size which is not available for a particular font.  This can be verified with xfontsel.  I just checked it on my workstation, and lucida doesn't seem to have a 200 pt size...it skips from 190 to 240.  There also isn't a "small" weight.
Update on the icons script,
It now will correctly grab the name of a terminal application.  
I haven't gotten "sudo" applications right yet.  There could be a menu command similiar to "xterm -e sudo <command>", or it could be "sudo [su -c] xterm -e <command>", so I haven't figured out how to guess which is being used in order to grab <command>.

Code Sample

#!/bin/bash
inpoot="${HOME}/.fluxbox/menu"
outpoot="${HOME}/.fluxbox/icon_menu"
icon_dir="${HOME}/.fluxbox/icons"

if [ -f "${outpoot}" ]; then
mv -f "${outpoot}" "${outpoot}.bak"
fi
cat "${inpoot}" | while read line; do
full_command=`echo "${line}"|awk -F { '{print $2}'|awk -F } '{print $1}'`
case "${full_command}" in
[aEx]term*-e*|rxvt*-e*|konsole*-e*|gnome-terminal*-e*)
command_name=`echo "${full_command}"|awk -F '-e' '{print $2}'|awk '{print $1}'|awk -F / '{print $NF}'`
;;
*)
command_name=`echo "${full_command}"|awk '{print $1}'|awk -F / '{print $NF}'`
;;
esac

icon_name="${icon_dir}/${command_name}.xpm"
if [ -f "${icon_name}" ]; then
echo "${line} <${icon_name}>" >> ${outpoot}
else
echo "${line}" >> ${outpoot}
fi
done

I've found the source of the corrupt menu item...it's in my $full_command variable.  If there is a menu item like this:
[exec] (something) {command | awk '{ print $ }'}
awk cuts at the first '}' instead of the last, so you end up with this as $full_command:
command | awk '{ print $
instead of this:
command | awk '{ print $ }'

I don't know how to fix it yet.


original here.