WICHTIG
Es gibt unzählige falsche Beispiele zu XRandR, z.B. 3 Monitoren sollte nicht über 3 Befehle an XRandR (auch nicht mit zusätzlichen Warteschleifen (sleep)) geschehen. Es sollte immer ein einzelner Befehl an XRandR sein, der wie in diesem Fall alle 3 Monitore gleichzeitig anpasst. Somit wird gewährleistet das es so keinen Fehlpositionen oder Überschneidungen bei der Reaktivierung kommt.
Benötigt wird (L)XRandr:
Code: Alles auswählen
sudo pacman -S lxrandr
Code: Alles auswählen
xrandr --listmonitors
Wobei ganz hinten immer der Anschlussname steht, diesen Namen verwenden wir dann in XRandR.0: +*DP-0 3840/607x2160/345+1920+0 DP-0
1: +HDMI-0 1920/598x1080/336+5760+0 HDMI-0
2: +DVI-I-1 1920/521x1080/293+0+0 DVI-I-1
Monitor-Type Anschlussname
HD-1 DVI-I-0
4K-1 DP-3
HD-2 HDMI-0
Beispiel für ein on-/off-Script
Beispiel 1
[hr][/hr]
[HD-1] off
[4K-1] on
[HD-2] off
Nur-4k-Monitor-AN.sh
Code: Alles auswählen
#!/bin/sh
xrandr --output DP-3 --off --output DVI-I-0 --off --output HDMI-0 --off --output DVI-I-1 --off --output DP-2 --off --output DP-1 --off --output DP-0 --primary --mode 3840x2160 --pos 1920x0 --rotate normal
[hr][/hr]
[HD-1] on
[4K-1] on
[HD-2] on
Alle-Monitore-AN.sh
Code: Alles auswählen
#!/bin/sh
xrandr --output DP-3 --off --output DVI-I-0 --off --output HDMI-0 --mode 1920x1080 --pos 5760x0 --rotate normal --output DVI-I-1 --mode 1920x1080 --pos 0x0 --rotate normal --output DP-2 --off --output DP-1 --off --output DP-0 --primary --mode 3840x2160 --pos 1920x0 --rotate normal
Für ARandR gibt man folgendes in das Terminal ein:
Code: Alles auswählen
sudo pacman -S arandr
Grüße der Prinz