From 7b5f58025a1dc1f35743d22fe821af7a9839fa46 Mon Sep 17 00:00:00 2001 From: Ryan Kes Date: Sun, 24 Mar 2019 17:27:40 +0100 Subject: [PATCH] only ad special mode if second monitor is connected --- dwm/.dwm/autostart.sh | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/dwm/.dwm/autostart.sh b/dwm/.dwm/autostart.sh index 855f035..e610486 100755 --- a/dwm/.dwm/autostart.sh +++ b/dwm/.dwm/autostart.sh @@ -1,12 +1,30 @@ #!/bin/sh +# Set screen orientation if second monitor is connected +SCREENCOUNT=$(xrandr | grep -c "\*") + +if [ "$SCREENCOUNT" -eq 2 ] +then + xrandr --newmode "2560x1440_40" 201.00 2560 2720 2984 3408 1440 1443 1448 1476 -hsync +vsync \ + && xrandr --addmode HDMI-2 2560x1440_40 \ + && xrandr --output DP-1 --mode 3840x2160 --primary --output HDMI-2 --mode 2560x1440_40 --left-of DP-1 --rotate left & +fi + # lock screen after x minutes and on laptop close lid xautolock -time 10 -locker lock & xss-lock lock & xbindkeys & compton --xrender-sync-fence & -feh --bg-scale ~/.cache/wall.png & + +if [ -e ~/.cache/wall1.png ] && [ -e ~/.cache/wall2.png ] +then + feh --bg-scale ~/.cache/wall1.png --bg-scale ~/.cache/wall2.png & +elif [ -e ~/.cache/wall1.png ] +then + feh --bg-scale ~/.cache/wall1.png & +fi + unclutter & redshift-gtk & dunst &