lmn-client/roles/lmn_fvs/templates/lmn-fix-screen.j2
Raphael Dannecker c068e85339 Fix primary screen for class room PCs with projector
Fixed EDID modes are set on the HDMI switch (ACER 120Hz problem).
This means that the affected PCs always see a second screen, even if beamer is off.

To avoid confusion, it must be ensured that no information is displayed on invisible devices:
- set primary screen for login dialog
- set primary screen after login
- clone screen
If the primary screen deviates from the standard, this information is maintained via inventory.

In addition, some PCs have different audio autputs than HDMI (or they have multiple HDMI outputs).
It is therefore possible to specify the audio device in the inventory.
2024-10-14 14:49:25 +02:00

28 lines
1.1 KiB
Django/Jinja

#!/usr/bin/bash
#
# Set the primary screen after login
# Clone screen on all displays
# Set audio-default-sink
#
set -eu
if [[ "$XDG_SESSION_TYPE" = wayland ]] ; then
while ! kscreen-doctor -o; do
sleep 1
done
{% if dual_screen is defined %}
kscreen-doctor output.{{ dual_screen[1] }}.priority.1
{% endif %}
for N in $(kscreen-doctor -j | jq -r .outputs[].name) ; do
kscreen-doctor output.$N.mode.{{ clonescreen_mode }} output.$N.position.0,0 output.$N.scale.$(kscreen-doctor -j | jq .outputs[].scale | sort | head -1);
done
fi
{% if audio_output is defined %}
pactl set-card-profile alsa_card.{{ audio_output[0] }} output:{{ audio_output[1] }}
pactl set-default-sink alsa_output.{{ audio_output[0] }}.{{ audio_output[1] }}
{% else %}
if pactl list cards | grep output:hdmi-stereo: | grep verfügbar:\ ja; then
pactl set-card-profile $(pactl list short cards | grep -m1 pci | head -1 | cut -f2) output:hdmi-stereo
pactl set-default-sink $(pactl list short cards | grep -m1 pci | head -1 | cut -f2 | sed s/card/output/g).output:hdmi-stereo
fi
{% endif %}