LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 11-03-2008, 06:59 AM   #1
gabrielvc
LQ Newbie
 
Registered: Sep 2006
Posts: 14

Rep: Reputation: 0
Unhappy 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!
 
Old 11-04-2008, 12:14 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,277
Blog Entries: 1

Rep: Reputation: 2137Reputation: 2137Reputation: 2137Reputation: 2137Reputation: 2137Reputation: 2137Reputation: 2137Reputation: 2137Reputation: 2137Reputation: 2137Reputation: 2137
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.
 
Old 11-05-2008, 07:17 AM   #3
gabrielvc
LQ Newbie
 
Registered: Sep 2006
Posts: 14

Original Poster
Rep: Reputation: 0
Wink 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.
 
Old 04-30-2009, 11:08 PM   #4
hucphin
LQ Newbie
 
Registered: Jun 2006
Location: Wisconsin
Distribution: Slackware
Posts: 16

Rep: Reputation: 1
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.
 
Old 05-03-2009, 03:40 PM   #5
gabrielvc
LQ Newbie
 
Registered: Sep 2006
Posts: 14

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by hucphin View Post

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...
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
available keyboard layouts sinister035 Linux - Newbie 4 07-02-2007 04:11 AM
Keyboard Layouts in IceWM the_new_z Linux - Software 3 04-08-2006 02:03 PM
switching between keyboard layouts trawler Linux - Software 1 10-22-2005 06:51 AM
keyboard layouts misulo Fedora 0 08-17-2004 01:29 PM
Shifting Keyboard Layouts! tolis Linux - General 1 12-12-2003 07:37 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 06:09 PM.

Contact Us - Advertising Info - Rules - Privacy - Donations - Contributing Member - LQ Sitemap - "Weather apps tell you it'll rain. Wyndo tells you when to go."
Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions