Skip to content

Instantly share code, notes, and snippets.

@coderofsalvation
Last active January 2, 2016 15:39
Show Gist options
  • Save coderofsalvation/8324578 to your computer and use it in GitHub Desktop.
Save coderofsalvation/8324578 to your computer and use it in GitHub Desktop.
returns 0 if monitor is attached
# returns 0 if monitor is attached
function ismonitorattached()
{
xrandr | grep "^VGA" | grep " connected" >/dev/null && return 0
xrandr | grep "^HDMI" | grep " connected" >/dev/null && return 0
return 1
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment