Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # find out the active monitor (tv or desk-monitors) and set corresponding sink
- if [[ $(xrandr --listactivemonitors | awk '!/Monitors/ {print $4}' | grep DP-2) == "DP-2" ]]; then
- MAIN_MONITOR=DP-2
- xrandr --output DP-0 --off --output DP-1 --off --output HDMI-0 --off --output DP-2 --primary --mode 2560x1440 --pos 1080x240 --rotate normal --output DP-3 --off --output DP-4 --off --output DP-5 --mode 1920x1080 --pos 0x0 --rotate left
- pactl set-default-sink $(pacmd list-sinks | grep -e 'name:' -e 'index:' | grep "Creative" | awk '{print $2}'| awk '{print substr($0, 2, length($0) - 2)}')
- else
- MAIN_MONITOR=HDMI-0
- xrandr --output DP-0 --off --output DP-1 --off --output HDMI-0 --primary --mode 1920x1080 --pos 0x268 --rotate normal --output DP-2 --off --output DP-3 --off --output DP-4 --off --output DP-5 --off
- pactl set-default-sink $(pacmd list-sinks | grep -e 'name:' -e 'index:' | grep "hdmi" | awk '{print $2}'| awk '{print substr($0, 2, length($0) - 2)}')
- fi
- GREEN='\033[0;36m'
- NC='\033[0m' # No Color
- echo -e "Connected monitors:" ${GREEN}$(xrandr --listmonitors | awk '!/Monitors/ {print $4}')
- echo -e "${NC}Primary monitor:" ${GREEN}$MAIN_MONITOR
- echo -e "${NC}Default sink:" ${GREEN}$default_sink
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement