Skip to content

Instantly share code, notes, and snippets.

@imvaskii
Last active October 24, 2019 02:29
Show Gist options
  • Select an option

  • Save imvaskii/2c317b8270dc2cc34f659464f9c56317 to your computer and use it in GitHub Desktop.

Select an option

Save imvaskii/2c317b8270dc2cc34f659464f9c56317 to your computer and use it in GitHub Desktop.
Bash scrip to executes xrandr layout for hdmi monitors.
#!/usr/bin/env bash
xrandr=$(xrandr)
con_monitors=$(echo $xrandr | grep -c " connected ")
if [[ $con_monitors -gt 1 ]]; then
# All the layouts are saved in "screenlayout" folder.
# eg. xrandr --output HDMI-1 --mode 2560x1440 --pos 0x0 --rotate normal --output DP-1 --off --output eDP-1 --primary --mode 1920x1080 --pos 283x1440 --rotate normal --output DP-2 --off
for layout in ~/.screenlayout/*.sh; do
./layout
done
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment