You are not logged in.
Pages: 1
xmodmap ~/.xmodmap won't work if I put it in my .xinitrc file, though will work if I type it manually.
My .xmodmap file:
remove Lock = Caps_Lock
keycode 0x16 = Caps_Lock
keycode 0x42 = BackSpace
add Lock = Caps_Lock
My .xinitrc file:
xmodmap ~/.xmodmap
xset -r 22
xset r 66
exec ck-launch-session startkde
My two xset commands work, but not xmodmap. I don't know what to do.
Last edited by sam113101 (2011-02-16 05:43:10)
Offline
If it is not a typo in your post, the entry should read
xmodmap ~/.xmodmap
as per the Wiki page https://wiki.archlinux.org/index.php/Xmodmap
Offline
The cursor (on my terminal window) was on the first character so it didn't copy it with the rest of the file. So yeah, that's a typo in my post, the file itself is good. That was nice from you to point it out. Thank you.
Offline
Then you should look at your syntax. I am not sure what you are trying to map, but to clear Caps_Lock I have:
clear Lock
Offline
It does the same thing.
Offline
Then something else in your syntax is broken...
Just posting "It does the same thing" isn't helping your cause - re-read the wiki page and work through your problem methodically. Just disable Caps_Lock and then, once you have confirmed that works, start trying to map another action to that key (if that is your intent).
No-one here is going to solve the problem for you: we can just point you at ways to attack it - you still have to do the work.
Offline
If that was the syntax, it would fail manually too, and not just while running it through xinitrc, no?
I'm sorry if I don't seem too cooperative for now, but I've done many google searches, did many attempts, and they all failed.
I'm going to sleep right now because it is getting late, and I will try to modify the syntax a bit tomorrow when I get the time to do it, try the solutions in that thread (if there are more as I wake up). I will keep you up-to-date of what failed and what partially worked.
Offline
If that was the syntax, it would fail manually too, and not just while running it through xinitrc, no?
My bad: I missed that it was working manually - sorry.
One way around it might be to try invoking it once X has definitely started:
(sleep 3 && xmodmap ~/.xmodmap ) &
Offline
I never achieved that xmodmap worked when started from xinitrc.
It might well be that with a sleep as jasonwryan says that it executes correctly, never tried it.
But it definitely works when executed from the Window Manager startup file (every decent
WM has one). That was my solution.
Mektub
Follow me on twitter: https://twitter.com/johnbina
Offline
Could it be that you are using a DE that is changing the keyboard settings? (KDE, gnome, xfce...)
Offline
Changing capslock via xmodmap often does not work properly, i think it does not work if xmodmap is called before the X-server has fully started.
There are several xkb-options to remap capslock, e.g.
setxkbmap -option caps:backspace
would map capslock to backspace, but there is no option to swap caps and backspace, but one could also create a custom option, but i have never done this.
The other option is the sleep option jasonwryan already suggested.
Offline
I tried to create a custom rule and was suckessfull doing the following steps:
create the directory ~/.xkb/symbols
in ~/.xkb/symbols create a file "mycaps" with the following content:
partial hidden modifier_keys
xkb_symbols "swapbackspace" {
key <CAPS> { [ BackSpace ] };
key <BKSP> { [ Caps_Lock ] };
};
In ~/.xkb/ execute
setxkbmap -print > keymap
where the content of keymap is
xkb_keymap {
xkb_keycodes { include "evdev+aliases(qwertz)" };
xkb_types { include "complete" };
xkb_compat { include "complete" };
xkb_symbols { include "pc+de(nodeadkeys)+inet(evdev)+compose(menu)+terminate(ctrl_alt_bksp)" };
xkb_geometry { include "pc(pc104)" };
};
Add the new option to the keymap-file, in my case
xkb_symbols { include "pc+de(nodeadkeys)+inet(evdev)+capslock(escape)+compose(menu)+terminate(ctrl_alt_bksp)+mycaps(swapbackspace)" };
In ~/.xinitrc load the new option
xkbcomp -I$HOME/.xkb $HOME/.xkb/keymap ${DISPLAY}
Offline
Pages: 1