Skip to content

Instantly share code, notes, and snippets.

@milin
Created April 27, 2011 03:27
Show Gist options
  • Select an option

  • Save milin/943666 to your computer and use it in GitHub Desktop.

Select an option

Save milin/943666 to your computer and use it in GitHub Desktop.
my script to make my external monitor the primary display if the ext monitor is connected
#!/bin/bash
NR_OF_MONITORS=$(xrandr -d :0 -q | grep ' connected' | wc -l)
if [ $NR_OF_MONITORS = "2" ]; then
xrandr --output DFP1 --primary
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment