You are not logged in.

#1 2022-03-06 17:48:01

goldmund
Member
Registered: 2021-02-15
Posts: 73

[SOLVED] X11 settings reset randomly

Hi,

I've got a problem with my X11 settings. I've got this in my ~/.config/X11/xprofile:

setxkbmap -option compose:ralt &
xset r rate 300 50 &

Every so often (every 1-2 hours or so) these settings get reset – meaning the compose key stops working and the keypress autorepeat (how fast the system types when you hold a key) goes back to its default slower speed. I then have to run the two commands above for it to start working again.

I haven't been able to observe a specific pattern or figure out the cause. Something must overwrite it, I just don't know what.

Do you have an idea? Thanks!

Last edited by goldmund (2022-03-07 13:35:20)

Offline

#2 2022-03-06 18:00:21

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: [SOLVED] X11 settings reset randomly

Which WM/DE are you using?
Some of them will override your settings with the values set in their GUI.


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#3 2022-03-06 18:19:20

goldmund
Member
Registered: 2021-02-15
Posts: 73

Re: [SOLVED] X11 settings reset randomly

Slithery wrote:

Which WM/DE are you using?
Some of them will override your settings with the values set in their GUI.

Sorry for not mentioning. I run dwm. Not sure if you find it relevant, but this is the output of:

$ grep -Ri "xset" ~/.local/share/dwm/*

Offline

#4 2022-03-06 21:33:10

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

Re: [SOLVED] X11 settings reset randomly

Don't fork those commands (though likely not the cause of your situation, you'll provoking a race condition in the setup nevertheless)

Every so often (every 1-2 hours or so) these settings get reset

How's the keyboard wired? USB, Bluetooth, …?
Do the reset coincidence w/ the keyboard re-appearing in your xorg log?

Offline

#5 2022-03-06 23:00:23

goldmund
Member
Registered: 2021-02-15
Posts: 73

Re: [SOLVED] X11 settings reset randomly

seth wrote:

Don't fork those commands (though likely not the cause of your situation, you'll provoking a race condition in the setup nevertheless)

Ok, I've never thought of that. I thought it's generally good practice to fork all commands inside xprofile.

seth wrote:

How's the keyboard wired? USB, Bluetooth, …?

Through a USB.

seth wrote:

Do the reset coincidence w/ the keyboard re-appearing in your xorg log?

Yes and this is the relevant output from /var/log/Xorg.1.log when I re-connect the USB keyboard. I should perhaps highlight the end:

client bug: event processing lagging behind by 35ms, your system is too slow

Could this have something to do with my issue?

I've just noticed that re-connecting the USB resets the X11 settings (as described in my 1st post). Could it be that the keyboard gets re-connected from time to time for a very brief moment and cause this issue?

And another discovery: the above settings get only reset on my USB keyboard while my laptop keyboard doesn't seem to be affected (the settings remain). Now I am very confused...

Offline

#6 2022-03-07 07:00:28

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

Re: [SOLVED] X11 settings reset randomly

Either the connection is a bit loose or https://wiki.archlinux.org/title/Power_ … utosuspend ("-1" disables it, also watch out for userspace services like TLP which will augment that setting)
To mitigate the impact you could set the autorepeat rate w/ a server flag, eg. for startx/xinit via https://wiki.archlinux.org/title/Xinit#xserverrc - https://wiki.archlinux.org/title/Xorg/K … up_options
and configure the ralt option w/ a configlet, https://wiki.archlinux.org/title/Xorg/K … tion_files

You should meanwhile also be able to re-use

Option "AutoRepeat" "delay rate"

in  the "InputDevice" section, https://www.phoronix.com/scan.php?page= … AutoRepeat

Offline

#7 2022-03-07 13:04:13

goldmund
Member
Registered: 2021-02-15
Posts: 73

Re: [SOLVED] X11 settings reset randomly

You have yet again provided excellent advice. Thank you! It seems to work well and the settings remain set, even when the keyboard gets disconnected.

This is what I've done (for others with similar problems):

# /etc/udev/rules.d/50-usb_power_save.rules
ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="1234", ATTR{idProduct}=="5678", ATTR{power/autosuspend}="-1"
ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="8765", ATTR{idProduct}=="4321", ATTR{power/autosuspend}="-1"

(I have also disabled autosuspend for my USB mouse which has solved very annoying lags! Amazing!!!)

# $HOME/.config/X11/xserverrc
exec /usr/bin/X -nolisten tcp -ardelay 300 -arinterval 20 "$@" vt$XDG_VTNR
# /etc/X11/xorg.conf.d/20-keyboard.conf
Section "InputClass"
        Identifier "system-keyboard"
        MatchIsKeyboard "on"
        Option "XkbOptions" "compose:ralt"
EndSection

Offline

Board footer

Powered by FluxBB