24 lines
349 B
Bash
Executable file
24 lines
349 B
Bash
Executable file
#!/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 [ -z "$(xrandr --query | grep "${1} connected")" ]; then
|
|
exit 1
|
|
else
|
|
exit 0
|
|
fi
|