diff --git a/bin/.bin/screenlayouts/docked-laptop-left.sh b/bin/.bin/screenlayouts/docked-laptop-left.sh index d9cf84c2..535d0ea2 100755 --- a/bin/.bin/screenlayouts/docked-laptop-left.sh +++ b/bin/.bin/screenlayouts/docked-laptop-left.sh @@ -3,9 +3,10 @@ laptopScreen="eDP-1" externalScreen="$(xrandr | grep -Eo '^.* connected' | grep -v "$laptopScreen" | cut -d ' ' -f 1)" +externalResolution="$(xrandr | grep -A 1 "$externalScreen" | sed -n 2p | awk '{print $1}')" pkill compton -xrandr --output "$laptopScreen" --primary --mode 1920x1080 --pos 0x0 --rotate normal --output "$externalScreen" --mode 1920x1080 --pos 1920x0 --rotate normal +xrandr --output "$laptopScreen" --primary --mode 1920x1080 --pos 0x0 --rotate normal --output "$externalScreen" --mode "$externalResolution" --pos 1920x0 --rotate normal /usr/bin/compton --config "$HOME/.config/picom/picom.conf" & disown # xrandr --output "$laptopScreen" --primary --mode 1920x1080 --pos 0x0 --rotate normal --output HDMI-2 --mode 1920x1080 --pos 1920x0 --rotate normal diff --git a/bin/.bin/screenlayouts/docked.sh b/bin/.bin/screenlayouts/docked.sh index 5ed076ab..a6cf36de 100755 --- a/bin/.bin/screenlayouts/docked.sh +++ b/bin/.bin/screenlayouts/docked.sh @@ -3,7 +3,8 @@ laptopScreen="eDP-1" externalScreen="$(xrandr | grep -Eo '^.* connected' | grep -v "$laptopScreen" | cut -d ' ' -f 1)" +externalResolution="$(xrandr | grep -A 1 "$externalScreen" | sed -n 2p | awk '{print $1}')" pkill compton -xrandr --output "$laptopScreen" --primary --mode 1920x1080 --pos 1920x0 --rotate normal --output "$externalScreen" --mode 1920x1080 --pos 0x0 --rotate normal +xrandr --output "$laptopScreen" --primary --mode 1920x1080 --pos "${externalResolution%x*}x0" --rotate normal --output "$externalScreen" --mode "$externalResolution" --pos 0x0 --rotate normal /usr/bin/compton --config "$HOME/.config/picom/picom.conf" & disown diff --git a/bin/.bin/screenlayouts/laptop-only.sh b/bin/.bin/screenlayouts/laptop-only.sh index 384a5efc..5b976f71 100755 --- a/bin/.bin/screenlayouts/laptop-only.sh +++ b/bin/.bin/screenlayouts/laptop-only.sh @@ -1,2 +1,5 @@ #!/bin/sh -xrandr --output eDP-1 --primary --mode 1920x1080 --pos 0x0 --rotate normal --output DP-1 --off --output HDMI-1 --off --output DP-2 --off --output HDMI-2 --off +pkill compton +xrandr | sed '/^ /d' | grep -Ev '(:|eDP-1)' | awk -v ORS=" " '{print "--output " $1 " --off"}' | + xargs xrandr --output eDP-1 --primary --mode 1920x1080 --pos 0x0 --rotate normal +/usr/bin/compton --config "$HOME/.config/picom/picom.conf" & disown