#!/bin/bash SCREENCONNECTED=$(xrandr|grep DP-1) if [[ -n "$(lsmod|grep nouveau)" ]]; then if [[ "$SCREENCONNECTED" == *connected* && "$SCREENCONNECTED" != *disconnected* ]]; then echo "Setup DP-1" # sleep 5 xrandr --output DP-1 --auto --primary --output LVDS-1 --auto --right-of DP-1 fi fi