Last active
November 7, 2020 13:29
-
-
Save RyanMillerC/c48d9f63f8fe386b22a7da18cf6913d2 to your computer and use it in GitHub Desktop.
Revisions
-
Ryan Miller revised this gist
Feb 10, 2018 . 1 changed file with 7 additions and 5 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,13 +1,15 @@ #!/bin/bash # # Created: 2017-07-02 16:20 # Updated: 2018-02-09 12:23 # Creator: Ryan Miller # Website: http://devopsmachine.com/ # File: /usr/local/bin/set-primary-monitor-pantheon-greeter # # Set correct primary monitor for login screen when lightdm greeter starts up on Elementary OS. # # Make sure to add the following line into /usr/share/lightdm/lightdm.conf.d/40-pantheon-greeter.conf (without the #) # greeter-setup-script=/usr/local/bin/set-primary-monitor-pantheon-greeter # # Change this variable to your primary display (Run 'xrandr -q' to see available displays) @@ -17,7 +19,7 @@ PRIMARY_DISPLAY='HDMI-0' x_out=$(xrandr -q | grep -e '\( \)connected' | awk -F' ' '{ print $1 }') # Safety - Check if PRIMARY_DISPLAY is connected; if not, bail out of script [[ $(grep ${PRIMARY_DISPLAY} <<< ${x_out}) ]] || exit 0 # Iterate over x_out and disable all monitors except for PRIMARY_DISPLAY for monitor in ${x_out[@]} ; do -
Ryan Miller renamed this gist
Jul 18, 2017 . 1 changed file with 4 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,21 +2,21 @@ # # { 2017-07-02 16:20 } # { Ryan Miller | [email protected] } # { /usr/local/bin/set-primary-monitor-pantheon-greeter } # # Set correct primary monitor for login screen when lightdm greeter starts up on Elementary OS. # # Make sure to add the following line into /usr/share/lightdm/lightdm.conf.d/40-pantheon-greeter.conf (without the #) # greeter-setup-script=/usr/local/bin/correct-screen-pantheon-greeter # # Change this variable to your primary display (Run 'xrandr -q' to see available displays) PRIMARY_DISPLAY='HDMI-0' # Get list of connected monitors x_out=$(xrandr -q | grep -e '\( \)connected' | awk -F' ' '{ print $1 }') # Safety - Check if PRIMARY_DISPLAY is connected; if not, bail out of script [[ $(grep ${PRIMARY_DISPLAY} <<< ${x_out}) ]] || exit 1 # Iterate over x_out and disable all monitors except for PRIMARY_DISPLAY -
Ryan Miller created this gist
Jul 3, 2017 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,29 @@ #!/bin/bash # # { 2017-07-02 16:20 } # { Ryan Miller | [email protected] } # { /usr/local/bin/correct-screen-pantheon-greeter } # # Set correct primary monitor for login when lightdm greeter starts up on Elementary OS. # # Make sure to add the following line into /usr/share/lightdm/lightdm.conf.d/40-pantheon-greeter.conf (without the #) # greeter-setup-script=/usr/local/bin/correct-screen-pantheon-greeter # # Run 'xrandr -q' to see available displays; insert the one you want as primary PRIMARY_DISPLAY='HDMI-0' # Get list of connected monitors x_out=$(xrandr -q | grep -e '\( \)connected' | awk -F' ' '{ print $1 }') # Check if PRIMARY_DISPLAY is connected; if not, bail out of script [[ $(grep ${PRIMARY_DISPLAY} <<< ${x_out}) ]] || exit 1 # Iterate over x_out and disable all monitors except for PRIMARY_DISPLAY for monitor in ${x_out[@]} ; do if [[ ${monitor} = ${PRIMARY_DISPLAY} ]] ; then xrandr --output ${monitor} --primary else xrandr --output ${monitor} --off fi done