yavdr-ansible/roles/yavdr-desktop/templates/systemd/user/detect-second-display.service.j2
2018-02-12 08:48:12 +01:00

10 lines
274 B
Django/Jinja

[Unit]
Description=Detect second DISPLAY using xrandr
[Service]
Type=oneshot
ExecStart=/bin/bash -c 'export DISPLAY=$DISPLAY.1; xrandr -q | grep "connected" && echo "DISPLAY=$DISPLAY" > ~/.second_display || rm -f ~/.second_display'
[Install]
WantedBy=yavdr-desktop.target