#!/bin/bash


# Find these for your system in xrandr output

laptopDisplay="eDP1"
laptopMode="--mode 1600x900"  # My preferred res for this (very dense!) display

extDisplay="DP1"
extMode="--auto"  # auto means the native res and best refresh rate

DPI=96


basename=$(basename "$0")


function usage {
   cat <<USAGE
$basename - Change active outputs

usage:
   $basename [OPTIONS] PROFILE

options:
   -h, --help  This help info

profiles:
   laptop   Laptop display only
   ext      External monitor only
   both     Both of the above outputs, laptop on the left

USAGE

   exit 1
}


case "$1" in
   laptop)
      set -x
      xrandr --output $laptopDisplay $laptopMode --output $extDisplay --off
      xrandr --dpi $DPI
      ;;
   ext)
      set -x
      xrandr --output $laptopDisplay --off --output $extDisplay $extMode
      xrandr --dpi $DPI
      ;;
   both)
      set -x
      xrandr --output $extDisplay $extMode --output $laptopDisplay $laptopMode --pos 2560x800
      xrandr --output $extDisplay --primary
      xrandr --dpi $DPI
      ;;
   *) usage ;;
esac

eval "$(~/.fehbg)"
fk
