You are not logged in.
Hi All,
I'm trying to map Hyper_L to mod3 using xmodmap; however, I'm getting an error, which I don't know how to fix. I've tried googling the problem with not much luck. The initial state of xmodmap:
$ xmodmap
xmodmap: up to 5 keys per modifier, (keycodes in parentheses):
shift Shift_L (0x32), Shift_R (0x3e)
lock
control Control_L (0x25), Control_R (0x69)
mod1 Alt_L (0x40), Alt_R (0x6c), Meta_L (0xcd)
mod2 Num_Lock (0x4d)
mod3
mod4 Super_L (0x42), Hyper_L (0x85), Hyper_R (0x86), Super_L (0xce), Hyper_L (0xcf)
mod5 ISO_Level3_Shift (0x5c), Mode_switch (0xcb)Then, I do the following:
$ xmodmap -e 'add mod3 = Hyper_L'
X Error of failed request: BadValue (integer parameter out of range for operation)
Major opcode of failed request: 118 (X_SetModifierMapping)
Value in failed request: 0x17
Serial number of failed request: 11
Current serial number in output stream: 11I've also tried
xmodmap -e 'add mod3 = Hyper_L'before the assignment, but it doesn't change anything.
I would be very grateful for any suggestions.
Thanks,
Anton
Last edited by beloglazov (2012-08-28 06:34:16)
Offline
I know it tells you to use the keysym, but did you try using the keycode as well?
Offline
Thanks, I've just tried that: there is no error, but the output of xmodmap doesn't change, and looks like the modifier doesn't get assigned.
Offline
Just a thought, I have never tried, but is a given key allowed to be in more than one mod group?
Offline
You are right, clearing the existing groups and then assigning new values works! Great idea, thanks a lot! For example, the following produced the desired map:
xmodmap -e "clear Mod1"
xmodmap -e "clear Mod2"
xmodmap -e "clear Mod3"
xmodmap -e "clear Mod4"
xmodmap -e "clear Mod5"
xmodmap -e "add Mod1 = Alt_L Alt_R Meta_L"
xmodmap -e "add Mod2 = Num_Lock"
xmodmap -e "add Mod3 = Hyper_L"
xmodmap -e "add Mod4 = Super_L Hyper_R"
xmodmap -e "add Mod5 = ISO_Level3_Shift Mode_switch"$ xmodmap
xmodmap: up to 4 keys per modifier, (keycodes in parentheses):
shift Shift_L (0x32), Shift_R (0x3e)
lock
control Control_L (0x25), Control_R (0x69)
mod1 Alt_L (0x40), Alt_R (0x6c), Alt_L (0xcc), Meta_L (0xcd)
mod2 Num_Lock (0x4d)
mod3 Hyper_L (0x85), Hyper_L (0xcf)
mod4 Super_L (0x42), Hyper_R (0x86), Super_L (0xce)
mod5 ISO_Level3_Shift (0x5c), Mode_switch (0xcb)However, I've faced another problem: I've added those lines into .xinitrc, but after X is started, the whole mapping gets reset to the default values. Here is my current .xinitrc:
(sleep 10s && xset b off) &
(sleep 10s && xset r rate 250 45) &
export PATH=~/bin:$PATH
xset +fp /usr/share/fonts/local
xsetroot -cursor_name left_ptr &
~/.mouse
numlockx &
xrdb -merge ~/.Xresources
xxkb &
emacs --daemon
urxvtd -q -o -f
chromium &
xmodmap -e "clear Mod1"
xmodmap -e "clear Mod2"
xmodmap -e "clear Mod3"
xmodmap -e "clear Mod4"
xmodmap -e "clear Mod5"
xmodmap -e "add Mod1 = Alt_L Alt_R Meta_L"
xmodmap -e "add Mod2 = Num_Lock"
xmodmap -e "add Mod3 = Hyper_L"
xmodmap -e "add Mod4 = Super_L Super_R"
xmodmap -e "add Mod5 = ISO_Level3_Shift Mode_switch"
exec ck-launch-session dbus-launch xmonadI've tried outputting the mapping before the 'exec ck-launch-session dbus-launch xmonad' line, and the values are correct at that point. Do you know what could reset the mapping?
Offline
You know you can put all those things in a single file and then just launch xmodmap /path/to/file. Presumably it should be in .Xmodmap I think. Then use what is in the skel file to launch it. See if that works. I would think that if it is resetting it, then it would still not work with the skel file, but it is worth a shot.
Edit: so my /etc/X11/xinit/xinitrc.d does not have the script to load xmodmap. But something like
[[ -f ~/.Xmodmap ]] && xmodmap ~/.XmodmapI guess that still doesn't solve the problem at hand though...
Last edited by WonderWoofy (2012-08-28 05:59:35)
Offline
I've just tried a separate file as you suggested, nothing's changed: it still gets set first correctly, but then resets to the defaults for some reason after launching xmonad.
Offline
try making a script with just xmodmap and then xmonad, call it something like startxmonad and then launch that instead. see what happens
Edit: so replace 'exec ck-launch.... xmonad' with 'exec ck-launch.... /path/to/startxmonad'
Last edited by WonderWoofy (2012-08-28 06:02:23)
Offline
I have never used xmonad, is there a dfault script that gets launched by the wm? Similar to the autostart script in openbox? or does xmonad documentation tell you to put it in xinitrc?
Offline
Sorry beloglzov, I have to get to bed, I have to work in the morning. I will check back with your thread here in the morning. Talk to you in about 8 hours. Good luck!
Offline
I found a solution in this thread: https://bbs.archlinux.org/viewtopic.php?pid=727258 Looks like it's some kind of a bug. I solved it by placing the following in my .xinitrc:
(sleep 15s && xmodmap ~/.Xmodmap) &Thank you very much for your help! ![]()
Offline
glad you solved it
Offline