#!/bin/bash
#
# Cycles screen rotations clockwise in 90 degree increments

RANDR=/usr/bin/xrandr
ORIENTATION=$($RANDR -q --verbose | grep eDP1 | awk '{print $6}')

echo $ORIENTATION

if [ ! -z "$ORIENTATION" ]; then
	case "$ORIENTATION" in
		"normal")
			$RANDR -o right;;
		"right")
			$RANDR -o inverted;;
		"inverted")
			$RANDR -o left;;
		"left")
			$RANDR -o normal;;
	esac
fi