datta/templates/monitors.sh.j2

18 lines
553 B
Text
Raw Normal View History

2024-02-20 11:03:06 +01:00
#!/bin/bash
monitors="$(xrandr | awk '/ connected/ {print $1}')"
num_monitors="$(echo "${monitors}" | wc -l)"
if [[ $num_monitors -ge 3 ]]; then
xrandr --output eDP-1 --off --output DP-4 --left-of DP-3 --primary --output DP-3 --auto
else
2024-02-20 12:35:16 +01:00
primary="$(echo "${monitors}" | head -n 1)"
output="$(echo "${monitors}" | tail -n 1)"
command="xrandr --output ${primary} --primary"
2024-02-20 11:03:06 +01:00
if [[ ${output} != ${primary} ]]; then
command="${command} --right-of ${output} --output ${output} --auto"
fi
${command}
fi
feh --bg-scale {{ wallpaper_path }}