You are not logged in.

#1 2022-01-10 20:38:57

zictes
Member
Registered: 2021-05-23
Posts: 10

Can't load .Xmodmap at startup

I just installed arch using the guided python script for the first time, which worked just fine except for xmodmap not working at startup.

According to the wiki lightdm is supposed to source ~/.Xmodmap, but it either doesn't do that or my changes get reverted immediately afterwards. The map itself is fine, it works as intended when I load it manually with

xmodmap ~/.Xmodmap

from the command line.

I've also tried putting that command in various locations that should get sourced at startup like ~/.profile, ~/.xprofile, ~/.Xresources, and even /etc/profile, /etc/xprofile, and just to be sure ~/.xinitrc even though I don't think that matters when using lightdm.

Using a startup script in ~/.config/autostart doesn't work either. The script definitely gets executed, but the xmodmap command simply has no effect at that point. Putting it in ~/.zshrc and opening a terminal works though, so it seems to get overriden by something.

Last edited by zictes (2022-01-10 20:52:37)

Offline

#2 2022-01-10 20:56:05

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,627

Re: Can't load .Xmodmap at startup

Which environment are you using? Most bigger DE's will have their own implementations that will override things you set earlier.

Offline

#3 2022-01-10 21:04:42

zictes
Member
Registered: 2021-05-23
Posts: 10

Re: Can't load .Xmodmap at startup

Thanks for the help! I'm using Budgie, as configured by the guided installer.

Last edited by zictes (2022-01-10 21:05:29)

Offline

#4 2022-01-10 21:24:28

seth
Member
Registered: 2012-09-03
Posts: 50,929

Re: Can't load .Xmodmap at startup

Any call to setxkbmap (or the equivalent xkb functions) will erase the modmap - you could try to delay the xmodmap call in your autostart script w/ a random "sleep 5; xmodmap …"

Offline

#5 2022-01-10 21:39:16

zictes
Member
Registered: 2021-05-23
Posts: 10

Re: Can't load .Xmodmap at startup

Thanks for the tip, but unfortunately that doesn't help either. Putting in the ~/.config/autostart script does nothing just like before even with the delay, and using it in ~/.profile doesn't work because that also halts the startup of Budgie.

Offline

#6 2022-01-10 21:52:42

seth
Member
Registered: 2012-09-03
Posts: 50,929

Re: Can't load .Xmodmap at startup

Are you positive that the script in  ~/.config/autostart gets executed (eg. by having it "touch /tmp/canary")?

using it in ~/.profile doesn't work because that also halts the startup of Budgie

(sleep 10; xmodmap $HOME/.Xmodmap 2>/tmp/xmodmap.errors) &

Offline

#7 2022-01-10 22:25:57

zictes
Member
Registered: 2021-05-23
Posts: 10

Re: Can't load .Xmodmap at startup

seth wrote:
(sleep 10; xmodmap $HOME/.Xmodmap 2>/tmp/xmodmap.errors) &

That did the trick, thank you so much! smile

2 seconds of sleep is enough to get past whatever Budgie is doing with xkb.

Offline

#8 2022-01-11 07:19:06

seth
Member
Registered: 2012-09-03
Posts: 50,929

Re: Can't load .Xmodmap at startup

Please always remember to mark resolved threads by editing your initial posts subject - so others will know that there's no task left, but maybe a solution to find.
Thanks.

Offline

Board footer

Powered by FluxBB