#!/usr/bin/env bash
# 
# SCRIPT NAME:
# is-connected
#
# AUTHOR:
# Severin Kaderli <severin@kaderli.dev>
#
# DESCRIPTION:
# Checks if the output is connected
#
# USAGE:
# ./is-connected OUTPUT

if [ -z "${1}" ]; then
    echo "No output given"
    exit 1
fi

if xrandr --query | grep -q "${1} connected"
then
    exit 0
else
    exit 1
fi
