Dotfiles/bin/.bin/screenlayouts/mirrored.sh
2024-02-22 21:21:13 +00:00

12 lines
584 B
Bash
Executable file

#!/bin/sh
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
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