You are not logged in.

#1 2021-08-06 18:22:05

nibblebot
Member
Registered: 2013-02-08
Posts: 5

[SOLVED] xmodmap, xset on hotplug keyboard

I have xmodmap and xset run on .xinitrc to setup my keyboard on login.
But on resume from suspend or hotplug keyboard, I will lose my xset and xmodmap settings.
I'm not lookgind to run a script after resume.
I would like to either set a config file for Xorg/udev or run a script that runs xset, xmodmap when any external keyboard is hotplugged.
I believe udev can do this, but I haven't found any configs for Arch yet.

Any ideas how to achieve hotplug xset/xmodmap?

Last edited by nibblebot (2021-08-07 04:30:08)

Offline

#2 2021-08-06 19:34:43

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 74,307

Re: [SOLVED] xmodmap, xset on hotplug keyboard

1st: what do you actually configure? Preferably use https://wiki.archlinux.org/title/Xorg/K … tion_files
2nd: https://wiki.archlinux.org/title/Udev#udev_rule_example - you just need to adjust vendor and model ID and the script to run
3rd: https://gist.github.com/AladW/de1c5676d93d05a5a0e1 (for the script you run)
4th. for STR specifically, https://wiki.archlinux.org/title/Power_ … leep_hooks

Offline

#3 2021-08-07 04:29:44

nibblebot
Member
Registered: 2013-02-08
Posts: 5

Re: [SOLVED] xmodmap, xset on hotplug keyboard

Thanks for the ideas. I ended up going with a static configuration.
I swap caps/esc in XkbOptions in my xorg.conf and I launch startx with extra arguments to pass in the key repeat delay and repeat rate.
Those are the only two configurations I was looking for and now I don't need to mess with udev/sleep hooks.

Cheers!

Offline

Board footer

Powered by FluxBB