[Solved] xmodmap running too late?

I have xmodmap set up to bind my multimedia keys - this works fine under other window managers (e.g. Enlightenment DR16) using xbindkeys. In FVWM, however, any keystrokes bound to a multimedia key are not recognised, unless I re-bind them using FvwmCommand after the wm has finished loading. I am guessing there might be an order-of-initialisation issue here, although I have at one point tried putting the bindings in a function delayed for 10 seconds and it still didn’t help. In case it’s important I am running fvwm 2.15.18 on gentoo, using gentoo-sources 2…6.18-r3 and xorg 7.1. The machine is an AMD64.

Some hopefully relevant config information:


keycode 234 = XF86Back keycode 233 = XF86Forward keycode 232 = XF86Stop keycode 231 = XF86Refresh keycode 229 = XF86Search keycode 230 = XF86Favorites keycode 178 = XF86HomePage keycode 236 = XF86Mail keycode 160 = XF86AudioMute keycode 174 = XF86AudioLowerVolume keycode 176 = XF86AudioRaiseVolume keycode 162 = XF86AudioPlay keycode 164 = XF86AudioStop keycode 144 = XF86AudioPrev keycode 153 = XF86AudioNext keycode 237 = XF86AudioMedia keycode 235 = XF86MyComputer keycode 161 = XF86Calculator keycode 223 = XF86Sleep keycode 115 = XF86Start keycode 116 = XF86Start keycode 117 = XF86MenuKB


[code]AddToFunc InitFunction

  • I Exec exec trayer
    –SetDockType false
    –widthtype request
    –heighttype pixel
    –height 24
    –edge bottom
    –align right
    –transparent true
    –alpha $[TrayerAlpha]
    –tint $[TrayerTint]
    –margin 0
    –distance 3
    –padding 2
  • I Exec exec numlockx on
  • I Exec exec xmodmap -e “clear Mod5”
  • I Exec exec xmodmap ~/.xmodmap
  • I Exec exec gkrellm2
  • I Exec exec sylpheed-claws
  • I Exec exec firefox-bin
  • I Exec exec gaim
  • I Exec exec skype
  • I Exec exec /home/matt/data/scripts/sig_pipe.py[/code]

My recipe:[code]# MCS Clean Vertical - a rotated desktop

Written by: Maciej Delmanowski harnir@post.pl

Modified by Matt

You can use folding to navigate this file

ImagePath {{{1

SetEnv Icon-Theme “Default”
ImagePath $[FVWM_USERDIR]/icons/$[Icon-Theme]:$[FVWM_SYSTEMDIR]/icons/$[Icon-Theme]

Includes and FVWM modules {{{1

Module FvwmCommandS

Default FVWM-Crystal functions, initialization {{{2

Include components/desktop/FVWM-Crystal_Functions

We need to “mask” some functions…

Include components/functions/Window-Buttons-Vertical
Include components/functions/Clear-FVWM-Settings
Include components/desktop/FVWM-Crystal_Preferences
Append preferences/Startup

Preferred applications {{{2

Include components/functions/Screenshot-import
Include components/apps/XScreenSaver
Include components/apps/FvwmMiniConsole

Desktop & window bindings {{{2

Include components/bindings/Desktop-MMB-EdgeScroll
Include components/bindings/Desktop-MMB-TogglePanels
Include components/bindings/Window-Basic
Include components/bindings/Window-Border
#Include components/bindings/Numpad-Control
#Include components/bindings/Numpad-Move

Keyboard bindings {{{2

#Include components/desktop/Keyboard-Vertical
#Include components/desktop/Keyboard-Vertical_NumLock

Use window thumbnails instead of simple icons on the desktop {{{2

Include components/desktop/Icon-Thumbnails

Various styles {{{2

Include components/desktop/FVWM-Crystal_Styles
Include components/styles/CursorStyle-Border

Desktop settings {{{1

EdgeScroll 100 100
EdgeResistance 700 700
HideGeometryWindow Move, Resize
OpaqueMoveSize 100
EdgeThickness 1
SnapAttraction 7 SameType Screen

EWMH-Desktop 3 3 3 3
EWMH-Panel-Right 60

Applications generator and main menu{{{1

fvwm-crystal.apps {{{2

PipeRead ‘fvwm-crystal.apps --database=$[FVWM_DISTROMENUDIR]/Applications --database=$[FVWM_SYSTEMDIR]/Applications --database=$[FVWM_USERDIR]/Applications --search-icons-in=$[FVWM_USERDIR]/icons/$[Icon-Theme]/32x32/categories:$[FVWM_USERDIR]/icons/$[Icon-Theme]/32x32/apps:$[FVWM_SYSTEMDIR]/icons/$[Icon-Theme]/32x32/categories:$[FVWM_SYSTEMDIR]/icons/$[Icon-Theme]/32x32/apps:$[FVWM_DISTROMENUDIR]/icons/$[Icon-Theme]/32x32/categories:$[FVWM_DISTROMENUDIR]/icons/$[Icon-Theme]/32x32/apps --default-file-icon=32x32/apps/default.png --default-dir-icon=32x32/categories/directory.png --min-submenu-length=5 --sort=prio --no-panel --check-execs’

Main “diamond” menu {{{2

DestroyMenu /FVWM-Crystal
AddToMenu /FVWM-Crystal

  • ‘%22x22/fvwm-crystal/applications.png%$[gt.Applications]’ Popup /Applications
  • “” Nop
  • ‘%22x22/fvwm-crystal/preferences-desktop-screensaver.png%$[gt.Screensaver]’ Popup /Screensaver
  • ‘%22x22/fvwm-crystal/camera-photo.png%$[gt.Screenshot]’ Popup /Screenshot
  • ‘%22x22/fvwm-crystal/audio-x-generic.png%$[gt.Music]’ Popup /Music
  • “” Nop
  • ‘%22x22/fvwm-crystal/preferences-desktop-theme.png%$[gt.Window decorations]’ Popup /Window-Decorations
  • ‘%22x22/fvwm-crystal/colorsets.png%$[gt.Colorsets]’ Popup /Colorsets
  • ‘%22x22/fvwm-crystal/preferences-desktop-wallpaper.png%$[gt.Wallpaper]’ Popup /Wallpaper
  • ‘%22x22/fvwm-crystal/preferences-desktop.png%$[gt.Preferences]’ Popup /Preferences
  • “” Nop
  • ‘%22x22/fvwm-crystal/applications-development.png%$[gt.Developer menu]’ Popup /Developer
  • ‘%22x22/fvwm-crystal/fvwm-crystal.png%$[gt.About FVWM-Crystal]’ Include components/functions/About
  • ‘%22x22/fvwm-crystal/system-log-out.png%$[gt.Exit]’ Popup /Exit

Style commands

Style * WindowShadeSteps 50

Windows open where?

Style Firefox StartsOnPage 1 0, SkipMapping

Mouse Shortcuts ========================================================================================

IgnoreModifiers 2

Open application menu on desktop

Mouse 1 R $[Mod0] Menu /FVWM-Crystal $[MenuPosition-BelowLeft]
Mouse 1 R A Menu /FVWM-Crystal $[MenuPosition-BelowLeft]

Open terminal on right click

Mouse 3 R N Exec exec aterm -tr -sh 50 -fade 75 -sl 1500 -sr -trsb

Mouse wheel change desktop (ctrl-shift overrides others)

Mouse 4 R N GotoPage-Up
Mouse 5 R N GotoPage-Down
Mouse 4 A CS GotoPage-Up
Mouse 5 A CS GotoPage-Down
#Mouse 4 R S Scroll 0 -25
#Mouse 5 R S Scroll 0 25

Shade window on wheel on title

Mouse 4 T N WindowShade True
Mouse 5 T N WindowShade False

More Keyboard Shortcuts ===============================================================================

Key XF86Calculator A N Exec exec gcalctool
Key XF86Mail A N Exec exec sylpheed-claws --compose
Key XF86HomePage A N Exec exec firefox-bin
Key XF86AudioMedia A N Exec exec /home/matt/data/scripts/audacious_ctl.py --toggle-all
Key XF86AudioPlay A N Exec exec audtool playback-playpause
Key XF86AudioStop A N Exec exec audtool playback-stop
Key XF86AudioPrev A N Exec exec audtool playlist-reverse
Key XF86AudioNext A N Exec exec audtool playlist-advance
Key XF86AudioMute A N Exec exec amixer set Master toggle
Key XF86AudioLowerVolume A N Exec exec /home/matt/data/scripts/audacious_ctl.py --volume-down
Key XF86AudioRaiseVolume A N Exec exec /home/matt/data/scripts/audacious_ctl.py --volume-up
Key XF86Sleep A N Exec exec xscreensaver-command -lock
Key F A SM FullScreen
Key equal A SM FullScreen
Key Up A CM GoToPage-Up
Key Down A CM GoToPage-Down

Pager {{{1

All (FvwmPager) Close
DestroyModuleConfig FvwmPager: *

SetEnv Desk-Pages-X “1”
SetEnv Desk-Pages-Y “6”

PipeRead ‘echo SetEnv FvwmPager-Width $((28*$[Desk-Pages-X])); echo SetEnv FvwmPager-Height $((24*$[Desk-Pages-Y]))’
*FvwmPager: Geometry -1-30@g
PipeRead ‘echo DesktopSize $[Desk-Pages-X]x$[Desk-Pages-Y]’

*FvwmPager: MiniIcons
*FvwmPager: Font none
*FvwmPager: WindowBorderWidth 1
*FvwmPager: Window3DBorders
#*FvwmPager: NoSeparators
*FvwmPager: UseSkipList
*FvwmPager: Colorset * $[cs-panel-inactive]
*FvwmPager: HilightColorset * $[cs-panel-active]
*FvwmPager: WindowColorsets $[cs-panel-wininactive] $[cs-panel-winactive]

Module FvwmPager

Change desktop pages using mouse wheel on pager and desktop

Mouse (FvwmPager) 4 W $[Mod] GotoPage-Up
Mouse (FvwmPager) 5 W $[Mod] GotoPage-Down

Settings for icons on the desktop {{{1

Style * IconBox 1200x800+30-30, IconFill left bottom, IconGrid 30 30
Style * StickyIcon

Settings of Trayer {{{1

AddToFunc ExitFunction

  • I Exec exec killall trayer
  • I Exec exec killall sig_pipe.py

ViM modeline {{{1


As a supplemental question, is there a way of getting fvwm to tell me what it thinks it has set up as key bindings?

Thanks in advance for any help, sorry about the long post.

Learn to use a pastebin in future – I am getting sick and tired of people assuming this is a dumping ground for extraneous information.


[code]AddToFunc InitFunction

  • I Exec exec numlockx on
  • I Exec exec xmodmap -e “clear Mod5”
  • I Exec exec xmodmap ~/.xmodmap
  • I Exec exec gkrellm2
  • I Exec exec sylpheed-claws
  • I Exec exec firefox-bin
  • I Exec exec gaim
  • I Exec exec skype
  • I Exec exec /home/matt/data/scripts/sig_pipe.py[/code]

Sigh – use StartFunction for this, and yes there can be an order of presedence. You should really be calling xmodmap from ~/.xsession if your crappy display manager honours it. Go read the following:

starshine.org/xteddy/thomas/ … .html#cf14
starshine.org/xteddy/thomas/ … fhobia.txt

– Thomas Adam

While I agree in principle (though not necessarily with the wording) I must add that it is sometimes hard for beginners to see just what is relevant.

That being said, the startup related functions would have sufficed in this case.

I think about every DM has a session named “Default session” or something along those lines that uses ~/.xsession (XDM uses it by default, GDM at the very least has this, KDM should too unless it got removed, entrance doesn’t come with any usable configuration for FVWM by default so you’d have to add it yourself anyway)

That’s why I referenced this in the last post. :stuck_out_tongue:

starshine.org/xteddy/thomas/ … .html#cf14

– Thomas Adam

Thanks for the info. It seems my problem is just that kdm is a pile of crap and completely ignores .xsession and/or .xinitrc (which rather means there aren’t any decent graphical login managers as far as I can tell). It functions perfectly well under startx.

Okay, sorry, I’ve never even heard the term pastebin before on any other forum, and I have been frequenting places such as the gentoo forums for many years. Over there posting plenty of config info is the norm, and the trouble with having a problem you can’t solve is that you don’t necessarily know what information is relevant to the discussion.

Might I suggest that you ask theBlackDragon to add this instruction to the forum guidelines post in the News section, as that currently only refers to using code tags for embedding. My psychic powers do not extend to determining unstated forum guidelines. Sorry about the OT reply - I will now set the thread to “solved” status.

As per one of the links I gave you, it ought to work if you choose the “failsafe” option. But if it doesn’t, it’s still broken.

No need, I’ve done it myself.

– Thomas Adam

Yeah, it’s broken. I generally avoid KDE and Gnome due to teh “let’s do things our way” thing but it’s the only login manager which works well with twinview. Ah well, back to the console.

Ah, I thought you might be in a position to do that. This will help rare vistors such as myself avoid the ire of the regulars - thanks.

XDM worked fine with TwinView for me, I’ve used it for quite some time to login on a 1024x768 + 1600x1200 TwinView setup…

Update: apparently KDM supports a ‘custom’ session which invokes .xsession so I’m now using it again.