You are not logged in.

#1 2010-03-17 15:47:42

drugcpp
Member
From: Israel
Registered: 2010-03-16
Posts: 20

[SOLVED] Xmodmap file

Hi everyone,
I've just migrated from Ubuntu to Arch and trying to arrange some stuff I had there. I use Xfce and SliM. I have .Xmodmap file like this:

clear Lock
keycode 66 = ISO_Next_Group

It makes CapsLock key switch layout. When I execute "xmodmap ~/.Xmodmap" in terminal it works, but when I put in in ~/.xinitrc file it doesn't.
My ~/.xinitrc:

exec ck-launch-session xfce4-session
xmodmap ~/.Xmodmap

I've searched the forum on this issue and is seems that this issue is known and not just mine. I just didn't manage to find a straightforwad solution to this. Is there a known solution to this problem?

Last edited by drugcpp (2010-03-17 21:17:03)

Offline

#2 2010-03-17 16:02:59

fsckd
Forum Fellow
Registered: 2009-06-15
Posts: 4,173

Re: [SOLVED] Xmodmap file

Move the xmodmap command before the exec command. (Do read man bash for what exec does and man xinit for what xinitrc is. Hint: it's a shell script.)

Last edited by fsckd (2010-03-17 16:05:53)


aur S & M :: forum rules :: Community Ethos
Resources for Women, POC, LGBT*, and allies

Offline

#3 2010-03-17 16:15:30

drugcpp
Member
From: Israel
Registered: 2010-03-16
Posts: 20

Re: [SOLVED] Xmodmap file

fsckd wrote:

Move the xmodmap command before the exec command. (Do read man bash for what exec does and man xinit for what xinitrc is. Hint: it's a shell script.)

xmodmap ~/.Xmodmap
exec ck-launch-session xfce4-session

don't work either.

Offline

#4 2010-03-17 16:30:54

n0dix
Member
Registered: 2009-09-22
Posts: 956

Re: [SOLVED] Xmodmap file

Write a script (for example. script.sh) with:

#!/bin/bash
xmodmap /home/username/.Xmodmap

Then, give the execute permissions

$ chmod +x script.sh

Follow this guide: link and put the script in the right directory.

P.S: i don't try it.

Offline

#5 2010-03-17 16:55:28

drugcpp
Member
From: Israel
Registered: 2010-03-16
Posts: 20

Re: [SOLVED] Xmodmap file

n0dix wrote:

Write a script (for example. script.sh) with:

#!/bin/bash
xmodmap /home/username/.Xmodmap

Then, give the execute permissions

$ chmod +x script.sh

Follow this guide: link and put the script in the right directory.

P.S: i don't try it.

Didn't work either sad
I've even tried to create .desktop file at ~/.config/autostart via "session and startup" GUI, without success.

Offline

#6 2010-03-17 18:07:45

anrxc
Member
From: Croatia
Registered: 2008-03-22
Posts: 834
Website

Re: [SOLVED] Xmodmap file

drugcpp wrote:

Didn't work either sad

Read my short introduction to xinitrc http://awesome.naquadah.org/wiki/Autost … tional_way


You need to install an RTFM interface.

Offline

#7 2010-03-17 18:43:27

drugcpp
Member
From: Israel
Registered: 2010-03-16
Posts: 20

Re: [SOLVED] Xmodmap file

Yeah OK I got what .xinitrc is, what's the point? Even if I put xmodmap before launching xfce4 session it doesn't work. Wherever I do, when I log in CapsLock has it traditional function. If I manually execute xmodmap in terminal I get exactly what I want. I don't get why it doesn't work while logging in.

Last edited by drugcpp (2010-03-17 18:44:42)

Offline

#8 2010-03-17 18:47:36

n0dix
Member
Registered: 2009-09-22
Posts: 956

Re: [SOLVED] Xmodmap file

Maybe the last post of this thread help you or at least give you an idea: link

Offline

#9 2010-03-17 18:51:24

ZaQ
Member
Registered: 2009-12-12
Posts: 106

Re: [SOLVED] Xmodmap file

From http://wiki.archlinux.org/index.php/Xfce:

To add programs to the startup using this method, add symlinks from the programs you want to $HOME/Desktop/Autostart.

In Ubuntu I found to add a .desktop to $HOME/.config/autostart/

Sry, but me is not using XFCE...

Offline

#10 2010-03-17 18:51:33

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: [SOLVED] Xmodmap file

You could try using the setxkbmap -option in .xinitrc


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#11 2010-03-17 19:26:29

drugcpp
Member
From: Israel
Registered: 2010-03-16
Posts: 20

Re: [SOLVED] Xmodmap file

Thank you guys for your help, but nothing worked until now, I've tried everything you wrote.

I wonder what those guys thought when they wrote Xfce? I mean, how am I supposed to figure out where to put this poor line so it works?

Last edited by drugcpp (2010-03-17 19:27:10)

Offline

#12 2010-03-17 19:53:02

fsckd
Forum Fellow
Registered: 2009-06-15
Posts: 4,173

Re: [SOLVED] Xmodmap file

Hmm, from http://wiki.xfce.org/faq: "Several problems with auto-loading of .Xmodmap files at xfce startup have been reported (also when issued as autostart command). Search the xfce bugzilla sites for current problems. As a workaround, run xmodmap ~/.Xmodmap by hand every time, or try out editing the somewhat less straightforward xkb configuration files."


aur S & M :: forum rules :: Community Ethos
Resources for Women, POC, LGBT*, and allies

Offline

#13 2010-03-17 20:02:02

anrxc
Member
From: Croatia
Registered: 2008-03-22
Posts: 834
Website

Re: [SOLVED] Xmodmap file

drugcpp wrote:

Yeah OK I got what .xinitrc is, what's the point?

The point is that you now know what xinitrc is, and how it works. Which you didn't know before, as seen from your own xinitrc file.

Even if I put xmodmap before launching xfce4 session it doesn't work.

No, it does work in the sense that xmodmap command would be executed when xinit or startx were executed them selves.

Why your modifier map table was not affected, or was reset, is purely an XFCE bug (or your own XkbOptions mistake in /etc/hal ?).

Last edited by anrxc (2010-03-17 20:03:46)


You need to install an RTFM interface.

Offline

#14 2010-03-17 20:21:31

drugcpp
Member
From: Israel
Registered: 2010-03-16
Posts: 20

Re: [SOLVED] Xmodmap file

Oh, I see now that it is a bug. I didn't play with XkbOptions. Should I mark this thread as solved? I doubt if there is anything to do besides waiting for bug correction...

Offline

#15 2010-03-17 20:21:51

Procyon
Member
Registered: 2008-05-07
Posts: 1,819

Re: [SOLVED] Xmodmap file

If xfce resets it, then run it later:

{ sleep 10; xmodmap ~/.Xmodmap; } &
exec ck-launch-session xfce4-session

Offline

#16 2010-03-17 21:15:14

drugcpp
Member
From: Israel
Registered: 2010-03-16
Posts: 20

Re: [SOLVED] Xmodmap file

Procyon wrote:

If xfce resets it, then run it later:

{ sleep 10; xmodmap ~/.Xmodmap; } &
exec ck-launch-session xfce4-session

It works, thank you!

BTW, If I click with right button on the Keyboard shortcut icon -> preferences, it resets keyboard map. I don't need those preferences anyway, it just an observation if anyone have the same problem in the future.

I am amazed by Arch community, you guys are awesome. smile

Offline

#17 2010-04-14 21:50:56

pSub
Member
Registered: 2009-04-06
Posts: 2

Re: [SOLVED] Xmodmap file

Only for information: This isn't a xfce bug. It appears in most windowmanagers (including xmonad, dwm and others).

Edit: The problem is old too http://lists.debian.org/debian-user/200 … 00377.html The only solution seems to start xmodmap after the window manager.

Last edited by pSub (2010-04-14 22:00:08)

Offline

#18 2010-04-14 22:09:44

n0dix
Member
Registered: 2009-09-22
Posts: 956

Re: [SOLVED] Xmodmap file

pSub wrote:

Only for information: This isn't a xfce bug. It appears in most windowmanagers (including xmonad, dwm and others).

Edit: The problem is old too http://lists.debian.org/debian-user/200 … 00377.html The only solution seems to start xmodmap after the window manager.

Yes, is an old bug, but i read only for Xfce4 system, i don't know for xmonad and dwm.

Offline

Board footer

Powered by FluxBB