Files
Helper-Scripts/kde-virtual-display-autoscale/99-auto-scale-virtual.rules
T

23 lines
1.0 KiB
Plaintext

# auto-scale-virtual.rules
#
# When the virtio-gpu display ("card0") reports a mode change — which
# spice-vdagent fires as it resizes Virtual-1 to match the SPICE client window
# (e.g. on dock/undock) — re-run the auto-scale script so Plasma's scale is
# fixed to match the new resolution.
#
# Install with:
# sudo install -m 644 99-auto-scale-virtual.rules \
# /etc/udev/rules.d/99-auto-scale-virtual.rules
# sudo udevadm control --reload-rules
#
# The script is invoked as the logged-in user via systemd-run, with the Plasma
# Wayland session environment hardcoded inside the script so it can reach
# kscreen-doctor. A short debounce lives in the script itself (flock), so the
# burst of change events from a single resize collapses to one application.
#
# Adjust the --uid/--gid values to match your user (run `id -u` / `id -g`).
ACTION=="change", SUBSYSTEM=="drm", KERNEL=="card0", \
RUN+="/usr/bin/systemd-run --uid=1001 --gid=1001 --no-block \
/home/hendrik/.local/bin/auto-scale-virtual.sh"