Provide dual screen setup where needed.

For SDDM, the projector is switched off: dual_screen[0].
For Wayland, dual_screen[1] is set as primary screen.
This commit is contained in:
Andreas B. Mundt 2024-02-14 12:49:27 +01:00
parent 07f34be546
commit 37e4108021
3 changed files with 185 additions and 123 deletions

View file

@ -188,6 +188,35 @@
[General]
loginMode=emptySession
- name: Fix primary screen for class room PCs with projector
block:
- name: Switch projector off for login
lineinfile:
dest: /usr/share/sddm/scripts/Xsetup
line: 'xrandr --output {{ dual_screen[0] }} --off'
- name: Deploy fix-screen script
ansible.builtin.template:
src: lmn-fix-screen.j2
dest: /usr/local/bin/lmn-fix-screen
mode: '0755'
- name: Deploy fix-screen autostarter
ansible.builtin.copy:
dest: /etc/xdg/autostart/lmn-fix-screen.desktop
content: |
[Desktop Entry]
Name=fix-screen
Exec=lmn-fix-screen
Type=Application
NoDisplay=true
when: dual_screen is defined
#- name: Avoid starting kscreen (confusing autodetection)
# ansible.builtin.copy:
# dest: /etc/xdg/kded5rc
# content: |
# [Module-kscreen]
# autoload=false
#
#- name: Disable automatic lock screen and user specific modifications
# ansible.builtin.copy:
# path: /etc/xdg/kscreenlockerrc

View file

@ -0,0 +1,10 @@
#!/usr/bin/bash
#
# Set the primary screen after login
#
set -eu
sleep 5
if [[ "$XDG_SESSION_TYPE" = wayland ]] ; then
kscreen-doctor output.{{ dual_screen[1] }}.priority.1
fi