Summary
autorandr fails to parse xrandr --verbose output when the user's locale uses a comma as decimal separator (e.g. de_DE.UTF-8, fr_FR.UTF-8, sv_SE.UTF-8). The mode-rate regex only accepts [0-9\.]+, but xrandr prints e.g. 90,00Hz under such locales.
Reproduction
LC_NUMERIC=de_DE.UTF-8 xrandr --verbose | grep -m1 'Hz +preferred'
# 2880x1800 (0x4c) 500,840MHz +HSync -VSync +preferred
# ^ comma, not dot
LC_NUMERIC=de_DE.UTF-8 autorandr --detected
# Parsing XRandR output failed, 12585 bytes left unmatched after regular
# expression, starting at byte 1658 with ..'2880x1800 '. (line 415)
Why systemd Environment=LC_ALL=C doesn't help
dispatch_call_to_sessions runs fork_child_autorandr which calls os.environ.clear() (autorandr.py:1283) and replaces the environment with the target user's session env. The systemd-service LC_ALL=C is wiped before xrandr is invoked.
Affected versions
Reproduced on Ubuntu 24.04 LTS, autorandr 1.14-2. Upstream master / 1.15 have the same regex ([0-9\.]+), so the bug exists there too.
Proposed fix
Accept both . and , in the rate regex, and normalize to . when storing the value so downstream xrandr --rate calls always see a dot. PR follows.
Summary
autorandrfails to parsexrandr --verboseoutput when the user's locale uses a comma as decimal separator (e.g.de_DE.UTF-8,fr_FR.UTF-8,sv_SE.UTF-8). The mode-rate regex only accepts[0-9\.]+, but xrandr prints e.g.90,00Hzunder such locales.Reproduction
Why systemd
Environment=LC_ALL=Cdoesn't helpdispatch_call_to_sessionsrunsfork_child_autorandrwhich callsos.environ.clear()(autorandr.py:1283) and replaces the environment with the target user's session env. The systemd-serviceLC_ALL=Cis wiped beforexrandris invoked.Affected versions
Reproduced on Ubuntu 24.04 LTS, autorandr 1.14-2. Upstream master / 1.15 have the same regex (
[0-9\.]+), so the bug exists there too.Proposed fix
Accept both
.and,in the rate regex, and normalize to.when storing the value so downstreamxrandr --ratecalls always see a dot. PR follows.