#!/bin/bash
INT_DISPLAYS=$(xrandr | awk '/\<connected\>/ {print $1}' | grep eDP)

if [[ -f "/usr/libexec/screen-rotate" ]]; then
    source "/usr/libexec/screen-rotate"
fi

if [ -f /etc/sk-chos/screen-rotate ]; then
    source /etc/sk-chos/screen-rotate
fi


if [ -z "${X11_ROTATION}" ]; then
    echo "Ignoring anything. Assume normal rotation"
else
    for INT_DISPLAY in ${INT_DISPLAYS}; do
      xrandr --output ${INT_DISPLAY} --rotate ${X11_ROTATION}
    done
fi