You are not logged in.

#1 2017-12-28 08:33:56

stee1rat
Member
Registered: 2013-10-22
Posts: 70

xmodmap doesn't remap keys on startup

According to this wiki article I created ~/.Xmodmap file:

cat ~/.Xmodmap
keysym XF86Back = Page_Up
keysym XF86Forward = Page_Down

The command xmodmap ~/.Xmodmap when run manually rebinds keys and everything works. However, when I restart my notebook xmodmap doesn't work.. The wiki says that for GDM (the login manager I use) I don't need .xinitrc and xmodmap has to run anyway. It doesn't. I tried creating .xinitrc, .xprofile, I tried to put exec xmodmap ~/.Xmodmap in my ~/.config/i3/config and nothing seems to work.

How can I run xmodmap on startup? I have GDM + i3wm.

Offline

#2 2017-12-28 09:16:50

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 78,863

Re: xmodmap doesn't remap keys on startup

GDM runs on wayland by default. No X11 there.
*Exactly* what "wiki says that for GDM" xmodmap would somehow autorun, that's nonsense.
Neither does it invoke xinitrc and whether xprofile is sourced depends on the session executable.

No idea why the command would'd execute from ~/.config/i3/config - https://i3wm.org/docs/debugging.html

Do you want this mapping for gdm or for the i3 session?
The straight forward solution is btw. to skip gdm and use xinit/startx and if you want the mapping to apply in gdm you'll have to configure gdm to use the xorg backend.

Offline

#3 2017-12-28 09:35:12

stee1rat
Member
Registered: 2013-10-22
Posts: 70

Re: xmodmap doesn't remap keys on startup

Thanks for the answer.

I am talking about xmodmap wiki page. It states that "With GDM, XDM or LightDM there is no need to source ~/.Xmodmap".

it doesn't work even with startx..

$ cat .xinitrc 
exec i3
xmodmap ~/.Xmodmap

Last edited by stee1rat (2017-12-28 09:47:22)

Offline

#4 2017-12-28 13:49:49

2ManyDogs
Forum Fellow
Registered: 2012-01-15
Posts: 4,648

Re: xmodmap doesn't remap keys on startup

stee1rat wrote:

it doesn't work even with startx..

$ cat .xinitrc 
exec i3
xmodmap ~/.Xmodmap

Of course this doesn't work. Nothing after "exec i3" will run.

arch wiki wrote:

Remember that lines following a command using exec would be ignored.

https://wiki.archlinux.org/index.php/Xinit#xinitrc

Last edited by 2ManyDogs (2017-12-28 13:52:25)

Offline

#5 2017-12-28 14:07:14

stee1rat
Member
Registered: 2013-10-22
Posts: 70

Re: xmodmap doesn't remap keys on startup

I tried it the other way and it didn't work either.

Offline

#6 2017-12-28 14:09:58

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 78,863

Re: xmodmap doesn't remap keys on startup

does i3 make any further calls to xmodmap or setxkbmap?
what if you "exec xterm" instead?

Also notice that this xinitrc will get you a broken session, read the article 2ManyDogs (how is that even possible?) linked.

Offline

#7 2017-12-28 14:22:39

stee1rat
Member
Registered: 2013-10-22
Posts: 70

Re: xmodmap doesn't remap keys on startup

It does a call to setxkbmap. It looks like they conflict with each other. However, even when I delete calls to setxkbmap xmodmap doesn't remap keys on start up. When I use it after setxkbmap it looks like it resets setxkbmap config.

Offline

#8 2017-12-28 14:24:35

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 78,863

Re: xmodmap doesn't remap keys on startup

Could you please paste your i3 config?

Offline

#9 2017-12-28 14:38:56

stee1rat
Member
Registered: 2013-10-22
Posts: 70

Re: xmodmap doesn't remap keys on startup

Here is my i3 config: https://pastebin.com/raw/TCptJcBN

BTW, I can see a lot of bindsyms there. Can I bind a key to PageUp and PageDown there? I can't find an example. Only a way to start some utility.

The lines with xmodmap are commented in my pastebin, I tried without them being commented. I tried with keysym XF86Back = Page_Up and keysym XF86Forward = Page_Down also.

Last edited by stee1rat (2017-12-28 14:43:27)

Offline

#10 2017-12-28 15:23:49

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 78,863

Re: xmodmap doesn't remap keys on startup

It's the dual layout thing - betting your right arm on it.

Offline

#11 2017-12-29 06:18:49

stee1rat
Member
Registered: 2013-10-22
Posts: 70

Re: xmodmap doesn't remap keys on startup

Can you explain what do you mean?

Offline

#12 2017-12-29 09:06:00

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 78,863

Re: xmodmap doesn't remap keys on startup

exec setxkbmap -layout us,ru
exec setxkbmap -option 'grp:alt_shift_toggle'

You got a US and a RU layout and that also seems your only concern about setxkbmap. I assume toggling the layout breaks xmodmap changes.

Offline

Board footer

Powered by FluxBB