#!/usr/bin/env bash # # SCRIPT NAME: # is-connected # # AUTHOR: # Severin Kaderli # # 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