Skip to content

Instantly share code, notes, and snippets.

@ayush--s
Created July 11, 2020 20:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ayush--s/69e4c7e55fc35ee5f2e094c997da9a2d to your computer and use it in GitHub Desktop.
Save ayush--s/69e4c7e55fc35ee5f2e094c997da9a2d to your computer and use it in GitHub Desktop.
#!/bin/bash
intern=LVDS-1
extern=HDMI-1
if xrandr | grep "$extern disconnected"; then
xrandr --output "$extern" --off --output "$intern" --auto
else
xrandr --output "$intern" --off --output "$extern" --auto
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment