Skip to content

Instantly share code, notes, and snippets.

@sammy44nts
Last active October 28, 2015 09:14
Show Gist options
  • Save sammy44nts/b3a01b254432b2ef45dd to your computer and use it in GitHub Desktop.
Save sammy44nts/b3a01b254432b2ef45dd to your computer and use it in GitHub Desktop.
Tweak on Linux Mint MDM to display the login screen only on one screen of two.
# At the end of /etc/mdm/Init/Default, I added the folowing code:
# Only display one screen:
screens="$(xrandr -q | grep -o "^.*[[:digit:]] connected" | tr -d ' connected')"
display_off="$(echo $screens | sed -e 's/^.*[[:digit:]] //')"
display_on="$(echo $screens | sed -e 's/ .*$//')"
if [ "$display_on" != "$display_off" ]; then
xrandr --output "$display_off" --off --output "$display_on" --auto --primary --preferred
fi
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment