Skrypt ustawiony jest, by uruchamiał się przed sesją KDE. Uruchamia się tylko raz, więc jeśli zrestartuję komputer przed podłączeniem stacji, to nie zadziała.
#!/bin/bash
#https://ubuntuforums.org/showthread.php?t=1458631
#https://askubuntu.com/questions/625761/how-to-change-displays-position-from-command-line
#https://www.tecmint.com/run-repeat-linux-command-every-x-seconds/
#exit 0
#sleep 10
EXTERN="DP-1-3"
xrandr --newmode "1680x1050_60.00" 146.25 1680 1784 1960 2240 1050 1053 1059 1089 -hsync +vsync
xrandr --addmode DP-1-3 "1680x1050_60.00"
#while true; do
if $(xrandr --prop |grep -q "$EXTERN connected");then
echo -e "$(echo $EXTERN | tr -d [0-9]) is \e[1;32mconnected\e[0m" xrandr --output DP-1-3 --mode "1680x1050_60.00" --pos 0x420
xrandr --output DP-1-1 --mode "1440x900" --rate 60 --pos 1680x0
xrandr --output eDP-1 --off
else
xrandr --auto
echo -e "$(echo $EXTERN | tr -d [0-9]) is \e[1;31mdisconnected\e[0m"
fi
#sleep 5
#done
#exit 0
Brak komentarzy:
Prześlij komentarz