From 70daba04134def1291e0b48fa75a2694e514e807 Mon Sep 17 00:00:00 2001 From: Jonathan Hodgson Date: Thu, 22 Feb 2024 21:21:13 +0000 Subject: [PATCH] Makes screen mirroring work on different resolutions --- bin/.bin/screenlayouts/mirrored.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/bin/.bin/screenlayouts/mirrored.sh b/bin/.bin/screenlayouts/mirrored.sh index b10d52f5..6646fa39 100755 --- a/bin/.bin/screenlayouts/mirrored.sh +++ b/bin/.bin/screenlayouts/mirrored.sh @@ -3,7 +3,10 @@ laptopScreen="eDP-1" externalScreen="$(xrandr | grep -Eo '^.* connected' | grep -v "$laptopScreen" | cut -d ' ' -f 1)" +laptopResolution="$(xrandr | grep -A 1 "$laptopScreen" | sed -n 2p | awk '{print $1}')" +xrandr | sed '/^ /d' | grep -Ev '(:|eDP-1)' | awk -v ORS=" " '{print "--output " $1 " --off"}' | pkill compton -xrandr --output "$laptopScreen" --primary --mode 1920x1080 --pos 0x0 --rotate normal --output "$externalScreen" --mode 1920x1080 --pos 0x0 --rotate normal -/usr/bin/compton --config "$HOME/.config/picom/picom.conf" & disown +pkill picom +xrandr --output "$laptopScreen" --primary --mode "$laptopResolution" --pos 0x0 --rotate normal --output "$externalScreen" --mode "$laptopResolution" --pos 0x0 --rotate normal +/usr/bin/picom --config "$HOME/.config/picom/picom.conf" & disown