Created
March 8, 2020 01:37
-
-
Save danilrwx/a95b0e7e873b6cd27ffa6ac298097f5e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| my_laptop_external_monitor=$(xrandr --query | grep 'VGA-1') | |
| while true; do | |
| if [[ $my_laptop_external_monitor = *connected* ]]; then | |
| xrandr --output VGA-1 --mode 1920x1080 --above eDP-1 | |
| #xrandr --output eDP-1 --primary --mode 1920x1080 --pos 0x1080 --rotate normal --output VGA-1 --mode 1920x1080 --pos 0x0 --rotate normal --output DP-1 --off --output HDMI-1 --off --output DP-2 --off --output HDMI-2 --off | |
| fi | |
| if [[ $my_laptop_external_monitor = *disconnected* ]]; then | |
| xrandr --output eDP-1 --primary --mode 1920x1080 | |
| fi | |
| sleep 1s | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment