Skip to content

Instantly share code, notes, and snippets.

View sammy44nts's full-sized avatar
🏠
Working from home

Sammy sammy44nts

🏠
Working from home
View GitHub Profile
@sammy44nts
sammy44nts / Default.sh
Last active October 28, 2015 09:14
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