Dotfiles/bin/.bin/screenlayouts/docked.sh
Jonathan Hodgson 792d9d8eaf Makes the screen layouts scripts slightly more robust
I should probably re-work all of them at some point but these changes
allow for external monitors with a resolution other than 1920x1080. When
switching to laptop only, I disable all other monitors by listing all
rather than hard coding common ones
2021-11-16 10:34:36 +00:00

10 lines
498 B
Bash
Executable file

#!/bin/sh
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 "${externalResolution%x*}x0" --rotate normal --output "$externalScreen" --mode "$externalResolution" --pos 0x0 --rotate normal
/usr/bin/compton --config "$HOME/.config/picom/picom.conf" & disown