Slackware This Forum is for the discussion of Slackware Linux.
|
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
11-03-2008, 06:59 AM
|
#1
|
|
LQ Newbie
Registered: Sep 2006
Posts: 14
Rep:
|
Xmodmap and two different keyboard layouts
I am runing bluewhite64, kde 3.5. I need two keyboard layouts, since I speack spanish and write code (english layout is better for that).
My .Xmodmap is the following,
Code:
remove control = Control_L Control_R
keycode 115 = Super_L Super_L
keycode 116 = Super_R Super_R
remove mod4 = Super_L
add control = Super_L Super_R
with permisions:
Code:
-rwxr-xr-x 1 gavox users 149 2008-10-29 18:56 .Xmodmap*
My /etx/X11/xinit is the following,
Code:
#!/bin/sh
# $XConsortium: xinitrc.cpp,v 1.4 91/08/22 11:41:34 rws Exp $
userresources=$HOME/.Xresources
usermodmap=$HOME/.Xmodmap
sysresources=/etc/X11/xinit/.Xresources
sysmodmap=/etc/X11/xinit/.Xmodmap
# merge in defaults and keymaps
if [ -f $sysresources ]; then
xrdb -merge $sysresources
fi
if [ -f $sysmodmap ]; then
xmodmap $sysmodmap
fi
if [ -f $userresources ]; then
xrdb -merge $userresources
fi
if [ -f $usermodmap ]; then
xmodmap $usermodmap
fi
# Start the window manager:
xmodmap /etc/X11/xinit/.Xmodmap
startkde
with permisions:
Code:
lrwxrwxrwx 1 root root 11 2008-10-25 13:24 xinitrc -> xinitrc.kde*
-rwxr-xr-x 1 root root 549 2008-10-29 19:41 xinitrc.kde*
But I still have to put an autostart script in the .kde folder to the file to be loaded at startup, since this does not do it (I don't know why!)
I also loose the changes if I switch keyboard layouts in kde. I just want to remap my win keys to control!
|
|
|
|
11-04-2008, 12:14 AM
|
#2
|
|
LQ Guru
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,277
|
Why go into all that trouble, if you can use the XkbOptions/XkbLayout in xorg.conf. Edit xorg.conf and in the "InputDevice" Section for you keyboard add or edit the following:
Code:
Section "InputDevice"
...
Option "XkbLayout" "us,es"
Option "XkbOptions" "grp:lwin_toggle,grp_led:scroll"
EndSection
You can toggle between english/spanish using the left win key. The scroll led will be used as an indicator for the language change.
|
|
|
|
11-05-2008, 07:17 AM
|
#3
|
|
LQ Newbie
Registered: Sep 2006
Posts: 14
Original Poster
Rep:
|
Swap control and Win AND have two layouts
Thanks for the hint, but I probably didn't make it clear enough. I need to swap control and win, as I use control the most and in this keyboard that key is not comfortable to use. (I do a lot of programing in emacs!) . For me the layout switching is no problem, is easily done in KDE, the problem is to do it keeping the CTRL and WIN keys switched.
Last edited by gabrielvc; 11-05-2008 at 07:19 AM.
|
|
|
|
04-30-2009, 11:08 PM
|
#4
|
|
LQ Newbie
Registered: Jun 2006
Location: Wisconsin
Distribution: Slackware
Posts: 16
Rep:
|
Try adding it to the ~/.Xmodmap file
Hi There,
I just ran into the same issue, and it took me a while to figure it out. Now you can save yourself all of the trouble by going through my problems, and just run it.
In my case, I call 'startx', which is simply a BASH Script to call start up my window manager. In there, one of the scripts that it looks for is $HOME/.xinitrc and /usr/lib/X11/xinit/xinitrc.
Look first to see where it might be located. If you look at the /usr/lib/X11/xinit/xinitrc file, it looks for a .Xmodmap file in the following locations: $HOME/.Xmodmap, and /usr/lib/X11/xinit/.Xmodmap. If you make the change in /usr/lib/... it will be sitewide, and if you do the change in $HOME/.Xmodmap, that will be user specific.
Then, when logged in as you, open your favorite text editor (which should be Vim!) and save the file to ~/.Xmodmap. Inside of the file, do not put the command that you use in the shell: xmodmap -e "keycode 117 = backslash bar". Instead, type this, one command per line, like this:
Code:
keycode 117 = backslash bar
Save the file, and restart X.
It should work like a champ. I realize that you posted this (3) years ago, but maybe someone else will find this useful, because if I had this problem, then I am sure that someone else did, and will still have this problem.
|
|
|
|
05-03-2009, 03:40 PM
|
#5
|
|
LQ Newbie
Registered: Sep 2006
Posts: 14
Original Poster
Rep:
|
Quote:
Originally Posted by hucphin
Look first to see where it might be located. If you look at the /usr/lib/X11/xinit/xinitrc file, it looks for a .Xmodmap file in the following locations: $HOME/.Xmodmap, and /usr/lib/X11/xinit/.Xmodmap. If you make the change in /usr/lib/... it will be sitewide, and if you do the change in $HOME/.Xmodmap, that will be user specific.
Then, when logged in as you, open your favorite text editor (which should be Vim!) and save the file to ~/.Xmodmap. Inside of the file, do not put the command that you use in the shell: xmodmap -e "keycode 117 = backslash bar". Instead, type this, one command per line, like this:
Code:
keycode 117 = backslash bar
|
Thanks for answering. I do have a .Xmodmap made that way and it is in my home directory. The other files (xinitrc, at /usr/lib/X11/xinit/xinitrc) are just like yours. My .bash_login is just the line:
xmodmap /home/gavox/.Xmodmap
So the short description of the problem is, changes done by using .Xmodmap do not take effect, even though xinitrc is just fine. To make them work, something else has to be done. Now I use slackware linux, same problem. I guess this may be related with kde, though...
|
|
|
|
All times are GMT -5. The time now is 06:09 PM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|