testsAndMisc/linux_configuration/features/systemd/monitor-autoconfig.service
Krzysztof kuhy Rudnicki 53da9b5a12 Monitors: best mode automatically on hotplug
systemd user service watches RandR output events and puts every
connected monitor at native resolution + max refresh, DP-0 primary
on the left, unplugged outputs switched off.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WzxdWXa4ytX9adN7qpMAop
2026-11-11 15:41:26 +01:00

18 lines
491 B
Desktop File

[Unit]
Description=Every monitor at its best resolution and refresh rate, on hotplug
After=graphical-session.target
# An X restart kills the watcher (exit 1) and Restart= brings it back; a
# genuinely broken setup trips this limit and shows as a failed unit.
StartLimitIntervalSec=300
StartLimitBurst=5
[Service]
Type=simple
Environment=DISPLAY=:0
ExecStart=/usr/bin/python3 @FEATURES_DIR@/monitor_autoconfig.py
Restart=on-failure
RestartSec=3s
[Install]
WantedBy=graphical-session.target