Skip to content

Instantly share code, notes, and snippets.

@0x4C4A
Created August 31, 2017 19:35
Show Gist options
  • Save 0x4C4A/8c09fdfc8e946cbff0f3026b513607da to your computer and use it in GitHub Desktop.
Save 0x4C4A/8c09fdfc8e946cbff0f3026b513607da to your computer and use it in GitHub Desktop.
Simple script to switch display configs with xrandr and restore multiscreen wallpaper with nitrogen
#!/bin/bash
if [ "$1" = "projector" ]; then
xrandr --output DP-1 --off
xrandr --output DP-3 --off
xrandr --output DP-5 --off
xrandr --output HDMI-0 --auto
elif [ "$1" = "screens" ]; then
xrandr --output HDMI-0 --off
xrandr --output DP-3 --auto --primary
xrandr --output DP-5 --auto --left-of DP-3
xrandr --output DP-1 --auto --right-of DP-3
else
xrandr --output DP-3 --auto --primary
xrandr --output DP-5 --auto --left-of DP-3
xrandr --output DP-1 --auto --right-of DP-3
xrandr --output HDMI-0 --auto --left-of DP-5
fi
sleep 1
nitrogen --restore
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment