Dotfiles/bin/.bin/screenlayouts/laptop-only.sh
Jonathan Hodgson 1a419c8670 Auto detect laptop resolution for screen layouts
New laptop is slightly taller than my last so updates the screenlayout
scripts to detect the resolution automatically
2022-02-07 12:35:50 +00:00

7 lines
400 B
Bash
Executable file

#!/bin/sh
pkill compton
laptopScreen="eDP-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"}' |
xargs xrandr --output "$laptopScreen" --primary --mode "$laptopResolution" --pos 0x0 --rotate normal
/usr/bin/compton --config "$HOME/.config/picom/picom.conf" & disown