bsdconf/xrandr/vga-or-hdmi.sh
2024-09-15 07:36:08 +03:00

8 lines
159 B
Bash
Executable file

#!/usr/bin/env bash
output=$(xrandr | awk '$2=="connected" { if ($1 ~ /VGA|HDMI/) { print $1 } }')
if [ -z "$output" ]; then
exit 1;
else
echo $output
fi