X and Fluxbox :: restart_fluxbox with a keymapping



A couple of days ago i added a keymapping to my "keys"-list (Mod1 z :restart_fluxbox) which works very well. (i do a lot of tweaking in init-files of fluxbox/xplanet and need to restart_fluxbox a lot)

BUT recentaly (on my logitech multimedia-keyboard at home) whenever i was typing in (for instance) scite and hit the z-key my fluxbox would restart (and no "z" would be shown in scite).

Therefor i have removed the "Mod1 z" but i am wondering why this is happening now (and not earlier or from the start).

Any hints?

I had a very similar thing happen to me yesterday, but it was with the menu key instead of mod1....I'd mapped "Menu M :RootMenu", but every time I pressed M by itself the menu would open.  I decided not to use the Menu key until I got it sorted.
My guess is that there is something messed up in the keymapping in X rather than Fluxbox, because you have the proper syntax in the keys file.  Did you use this same keyboard successfully before, with the same keyboard chosen at startup?  The multimedia keys on my logitech do not even register in DSL with the default keyboard chosen.

Also, instead of restarting fluxbox, try using "reconfigure" instead.  This reloads the init file rather than restarting the whole window manager.  For  style edits, try "reloadstyle".

Did you use this same keyboard successfully before, with the same keyboard chosen at startup?  The multimedia keys on my logitech do not even register in DSL with the default keyboard chosen.

Like yourself my multimedia-keys on my logitech keyboard do not register in DSL. The "Mod1 0 : restart_fluxbox" has worked before on my logitech- (at home) and on my HP-keyboard (at work).

Thnx for the tip -> "reconfigure"/"reloadstyle"

How's fluxbox-0.9.11 coming along? (any problem there with keymappings?) Have you added icons to your fluxbox-menu yet? I have been snooping around for a fluxbox config application which will help me with adding xpm-files to the menu. (not found yet) All i have seen so far are: whitebox and FluxConf (screenshots that is..)

Would be nice in the future if we could add color/fonts/styles to individual lines in the fluxbox menu...

Does Mod1 work for any other key bindings?  It might be the "restart_fluxbox" thing confusing the application.  The recommended command is "restart" with the window manager as an argument:
Mod1 Z :Restart fluxbox  or  Mod1 Z :Restart restart_fluxbox or Mod1 Z :Restart
in the DSL menu it is listed as "[restart] (restart) {restart_fluxbox}" and this loads /usr/bin/fluxbox regardless of which version you are currently using.  If you're running fluxbox-devel, just using "restart" should be enough.
Of course this might not be the problem, since i don't know how fluxbox interprets its configuration files, but I can't think of any other reason why Mod1 wouldn't work.

I personally don't use icons, so haven't done much with them.  The fluxbox-generate_menu script which comes with the official fluxbox package now includes limited support for program icons.  What it does is look in ~/.fluxbox/icons/ for xpm files with the same name as the applications (e.g. firefox.xpm), and uses those.  This script isn't in the DSL extension because I'd need to incorporate the myDSL menu into it...something I just haven't wanted to bother with.
 
One thing I did do just as a test was to add submenu icons to  fluxbox-generate_menu (for my non-DSL system) by just adding an icon to the append_submenu function.  I didn't keep it, though, since the built-in arrows are enough for me.

The great thing about the way icons are used in the fluxbox menu is that they are added simply by slapping on a filename to the end of a line.  It should be very easy to write a bash script that will do this for you.  In fact, the addition to fluxbox-generate-menu could probably be ripped out and modified to work as its own self-contained script to run on the DSL menu.
I think maybe I'll try that today.

The new extension seems to work fine, better than 0.9.10 in my opinion....there's a little info about its status on the DSL Talky-Bloggy  thingy.  I'm waiting to hear from the creator of the potential wallpaper, but until then I've been spending an hour or two each day tinkering with it just to see how easy-to-use-straight-out-of-the-package I can make it .

Quote
Would be nice in the future if we could add color/fonts/styles to individual lines in the fluxbox menu...

wow...I never thought about that.  That's a really good idea.  Personally I don't know how much i'd use it, but it would be handy for some things.  
Take for example filetypes... you could have a different color for submenus and remove the arrows....or if you have a setup like mine where my menu contains some individual files, like reference material and various config files, those files could be a different color/style than the programs...also altering the color of arrows and separators could be useful.

What i don't get, though, is something I just noticed....you can't change the font of just window titles.  In other words, there is no window.label*font resource...it's just a window.font.  This might not be noticeable in most situations, but if you change the font for a window it also changes the font for the command dialog...it's really hard to read a dialog that has black text with a black shadow.

Quote
I have been snooping around for a fluxbox config application which will help me with adding xpm-files to the menu


Here's what I have so far.  It's kinda sloppy, with 4 awk commands in a single line, but I don't know much about editing text files from a script yet.  Probably should use cut instead, but I don't know that program yet.

This will create a duplicate of your menu, named icon_menu, using icons found in a specified directory.  The icons need to be named the same as the command + xpm extension, and it's case-sensitive.

Something I never thought about was terminal applications.  This first version of the script reads only the term name, so if you have a vim icon, for example, it will use an icon for whatever terminal program you are using to run vim.  You'll need to edit the proper icon in by hand until I get something better.

There's also a problem with it properly writing certain menu lines.  For example, I have one line which allows me to edit the current style and it needed a backslash in it in order to write the appropriate command:
aterm -e vim `grep styleFile ~/.fluxbox/init | awk '{ print $2 \}'`
When that line is echoed, the backslash is overlooked and the command no longer works because fluxbox thinks that last curly bracket is the end of the command.  This should not be a problem for you unless you're into making menu commands like that.


As always, keep a backup of your original menu.

Code Sample

#!/bin/bash

input_file="${HOME}/.fluxbox/menu"
output_file="${HOME}/.fluxbox/icon_menu"
icon_dir="${HOME}/.fluxbox/icons"

cat /dev/null > ${output_file}
cat "${input_file}" | while read line; do
command_name=`echo "${line}"|awk -F { '{print $2}'|awk -F } '{print $1}'|awk '{print $1}'|awk -F / '{print $NF}'`
icon_name="${icon_dir}/${command_name}.xpm"
if [ -f "${icon_name}" ]; then
echo "${line} <${icon_name}>" >> ${output_file}
else
echo "${line}" >> ${output_file}
fi
done


If you've got 16-pixel icons and they look all crunchy you can put this into your style file:
menu.itemHeight: 16 (might need to be slightly larger than 16)
It'll make your menu taller, but the icon will look better.

Next Page...
original here.