You are not logged in.
Pages: 1
Hi, I switch to arch linux recently and as an emacs user it's very important to remap the capslock by ctrl. From the wiki I know the setxkbmap command but that seems not permenant: during the session the capslock randomly comes back ... Moreover I can't set it with the startup: I add it in the .xinitrc but nothing happens, even with the sleep command.
exec ck-launch-session startxfce4
sleep 8;setxkbmap -option "ctrl:nocaps"
Then I tried to add a file named 01-keyboard-layout.conf in the /etc/X11/xorg.conf directory:
Section "InputDevice"
Identifier "IntergratedKeyboard"
Driver "keyboard"
Option "XkbOptions" "ctrl:nocaps"
EndSection
But nothing happens to the capslock and I can't launch my emacs...
So really confused by this, any suggestion on a better approach to remap this evil key permanantly?
###############################################################
###############################################################
Ok .... Finally I did it.
The problem is just like what I found, it's the XFCE-xkb-plugin that resets all the keyboard maps.
So I disable the plugin then creat a conf file in /etc/X11/xorg.conf.d and named 50-keyboard-layout.conf:
Section "InputClass"
Identifier "Keyboard"
Driver "evdev"
Option "XkbLayout" "us,fr"
Option "XkbOptions" "ctrl:nocaps,grp:alt_shift_toggle"
MatchIsKeyboard "on"
EndSection
It details that I have two layouts (us,fr) and by using alt+shift I can toggle between them, and no XFCE plugins so the simple keymap just works.
Thanks again for helping me and I put it here in case some one else will find useful.
Last edited by darkjh (2011-11-11 00:30:47)
Offline
You should be able to do that with xmodmap. Create a /home/~/.xmodmap file with the appropriate text (i.e. keysym nnn = Ctrl) [something like that - I don't know offhand if Ctrl is the proper name]. You can run xev in terminal to see what the current keysym number is for CapsLk. You can press Ctrl while in xev to see how that key is mapped. You can run xmodmap -pke in terminal to see all your current key mappings.
Offline
$ cat /etc/X11/xorg.conf.d/50-keyboard.conf
Section "InputClass"
Identifier "Keyboard"
Driver "evdev"
Option "XkbLayout" "us"
Option "XkbVariant" "altgr-intl"
#Option "XkbVariant" "colemak"
Option "XkbOptions" "caps:backspace,eurosign:e"
MatchIsKeyboard "on"
EndSection
I have set up caps as backspace and few other things with this config. Notice "InputClass" not "InputDevice".
Offline
$ cat /etc/X11/xorg.conf.d/50-keyboard.conf Section "InputClass" Identifier "Keyboard" Driver "evdev" Option "XkbLayout" "us" Option "XkbVariant" "altgr-intl" #Option "XkbVariant" "colemak" Option "XkbOptions" "caps:backspace,eurosign:e" MatchIsKeyboard "on" EndSection
I have set up caps as backspace and few other things with this config. Notice "InputClass" not "InputDevice".
Eh.. it works for the beginning but as the setxkbmap, the capslock randomly comes back... Very strange..
Last edited by darkjh (2011-11-03 23:23:37)
Offline
keycode 66 = Control_L
clear Lock
add Control = Control_L
I have this in .xmodmap, in .xinitrc i call "xmodmap ~/.xmodmaprc" this. It clears the capslock and puts a ctrl on the key.
Ogion
(my-dotfiles)
"People willing to trade their freedom for temporary security deserve neither and will lose both." - Benjamin Franklin
"Enlightenment is man's leaving his self-caused immaturity." - Immanuel Kant
Offline
keycode 66 = Control_L clear Lock add Control = Control_L
I have this in .xmodmap, in .xinitrc i call "xmodmap ~/.xmodmaprc" this. It clears the capslock and puts a ctrl on the key.
Ogion
I've tried all these method but none of them is permanent for me here, the caps lock just comes back after a while. When the system starts the key map is good but then it just comes back.
Offline
Very weird. That doesn't happen to me.
You are saying that, without restarting X/loggin out-back in, it just at some point reverts back to being Capslock?
Got any other programs doing some manipulation with the keymap running or something?
If not, i don't have an idea as to what it might be.
Ogion
(my-dotfiles)
"People willing to trade their freedom for temporary security deserve neither and will lose both." - Benjamin Franklin
"Enlightenment is man's leaving his self-caused immaturity." - Immanuel Kant
Offline
Very weird. That doesn't happen to me.
You are saying that, without restarting X/loggin out-back in, it just at some point reverts back to being Capslock?Got any other programs doing some manipulation with the keymap running or something?
If not, i don't have an idea as to what it might be.
Ogion
It's nealy a new system here so not many programs. And even I start the system and just do nothing, some time later the evil key came back...
Is there any tool can track all the changes to the key map?
Offline
A shot in the dark: This could possible happen somewhere on system level. Which DE/WM do you use?
Are there any bash scripts which affect the key map settings?
Perhaps this helps: Follow top/htop after the system start (doing nothing else) if anything suspicious is called.
To know or not to know ...
... the questions remain forever.
Offline
A shot in the dark: This could possible happen somewhere on system level. Which DE/WM do you use?
Are there any bash scripts which affect the key map settings?Perhaps this helps: Follow top/htop after the system start (doing nothing else) if anything suspicious is called.
Today I spent some time on it but just cant figure it out. When the system is up every thing is ok and no strange process. Then I tried every program/software that I have, just one time I launched nano and the caps lock key came back, but after that I repeated this (launching nano) for at least 50 times but it didn't happen anymore.
And it's like when the system is on for a while, maybe 30 minutes, the caps lock will come back...
I'm using XFCE4.8.
Offline
For me it comes back when I re-plug my keyboard, perhaps you've been plugging it in and out in these situations? feels like a long shot though.
Offline
I use an xmodmap script in autostart to remap my caps lock key to <.
Sometimes it does reset back, but re-running the script fixes it. I notice this does happen when I set the system to sleep. Do you have any power saving features that could be doing it?
If there's no other way, how about setting a keyboard shortcut that runs your script again? It you notice it's reverting, hit it to restore.
Offline
I use an xmodmap script in autostart to remap my caps lock key to <.
Sometimes it does reset back, but re-running the script fixes it. I notice this does happen when I set the system to sleep. Do you have any power saving features that could be doing it?If there's no other way, how about setting a keyboard shortcut that runs your script again? It you notice it's reverting, hit it to restore.
I'm using the laptop-mode for some power-saving but it affects the keyboard map?
How to set a keyboard shortcut? I tried it with the tools of XFCE but it doesn't execute the command.
Offline
I'm been think that can I just alter the keyboard layout file to disable the caps lock key? If I can how should I do it?
Offline
I'm using the laptop-mode for some power-saving but it affects the keyboard map?
How to set a keyboard shortcut? I tried it with the tools of XFCE but it doesn't execute the command.
Well, if the power saving makes the computer sleep, it might affect it.
As for the xfce shortcuts, setting something to run the script's file in keyboard preferences is enough. Maybe you need to chmod +x the file with your script?
Offline
I think I've found the cause, because I use xfce-xkb-plugin to change keyboard layout between fr and us ... And it seems this plugin detects all the keyboard mapping changes and reset it from time to time.
So really upset by this issue. Can I use another tool for keyboard layout change?
Offline
I think I've found the cause, because I use xfce-xkb-plugin to change keyboard layout between fr and us ... And it seems this plugin detects all the keyboard mapping changes and reset it from time to time.
So really upset by this issue. Can I use another tool for keyboard layout change?
I use a launcher that runs the following bash script:
#!/bin/bash
if setxkbmap -query |grep -q "us$"
then
setxkbmap carpalx
else
setxkbmap us
fi
Alternately, I have bash aliases: asdf switches to carpalx and dstn (same keys) switches to us. Both methods could be modified to 'reassert' your custom changes.
Last edited by alphaniner (2011-11-10 22:54:53)
But whether the Constitution really be one thing, or another, this much is certain - that it has either authorized such a government as we have had, or has been powerless to prevent it. In either case, it is unfit to exist.
-Lysander Spooner
Offline
Pages: 1