This is an old revision of the document!
Workstations with a dual-monitor setup have some issues with deciding which monitor to use as the primary monitor. This will cause some issues with some games, applications, and issues with screen alignment.
In order to fix these issues, Josh Kilmer (jkilmer) (srjek) has written some scripts to aid in the process of setup.
# Begin Josh Kilmer's (jkilmer)(srjek) dualmonitor script xrandr --output DVI-I-3 --off # Turn off secondary monitor to fix window snapping alignment issue xrandr --auto # For connected but disabled outputs, this will enable them using their preferred mode xrandr --output DVI-I-3 --left-of DVI-I-2 # Set secondary monitor to be on the left (DVI-3) xrandr --output DVI-I-2 --primary # Set primary monitor to the on on the right (DVI-2) # End Josh Kilmer's (jkilmer)(srjek) dualmonitor script
Please note that this has only been testing on the HP workstations running Arch, and have not been extensively testing on single-monitor setups and the like.
— Chase Lee 2013/04/27 02:19
In order to automate this process,(instead of making users do this themselves) we can put this script in the corresponding LXDM configurations files. The LXDM files are run at specific times during the login and logout process. Appending these commands will automatically setup the dual-monitor layout.
The following are copies of the modified LXDM configurations files as of April 27, 2013: Note that these settings should not be applied to single-monitor setups, as this may result in unintended results.
#!/bin/sh # # Note: this is a sample and will not be run as is.
#!/bin/sh # # Note: this is a sample and will not be run as is. #loltask > /dev/null & thunar --daemon & #if [ ! -d "/home/$USER/Steam" ] #then # mkdir /home/$USER/Steam # echo "/home/$USER/Steam created on $HOSTNAME" >> /var/log/test #fi #sudo /usr/local/bin/steamMount $USER
#!/bin/sh # # Note: this is a sample and will not be run as is.
#!/bin/sh # # Note: this is a sample and will not be run as is. if [ "$USER" == "acmguest" ] then umount /opt/acmguest/.local/share/Steam sudo /usr/local/sbin/guestd restart fi if [ "$USER" == "lol" ] then umount /opt/lol/.local/share/Steam else umount /home/$USER/.local/share/Steam fi killall --user $USER -TERM # Begin Josh Kilmer's (jkilmer)(srjek) dualmonitor script xrandr --output DVI-I-3 --off # End Josh Kilmer's (jkilmer)(srjek) dualmonitor script
#!/bin/sh # # Note: this is a sample and will not be run as is. #!/bin/sh # # Note: this is a sample and will not be run as is. #loltask > /dev/null & #mount -B /opt/Steam /home/$USER/Steam #if [ "$?" -ne "0" ] #then # mkdir /home/$USER/Steam # mount -B /opt/Steam /home/$USER/Steam #fi if [ "$USER" == "lol" ] then mount -B /opt/Steamlocal /opt/lol/.local/share/Steam chown -R lol:users /opt/lol/.local/share/Steam else if [ "$USER" == "acmguest" ] then mount -B /opt/Steamlocal /opt/acmguest/.local/share/Steam chown -R acmguest:users /opt/acmguest/.local/share/Steam else mount -B /opt/Steamlocal /home/$USER/.local/share/Steam if [ "$?" -ne "0" ] then mkdir /home/$USER/.local/share/Steam mount -B /opt/Steamlocal /home/$USER/.local/share/Steam fi chown -R $USER:users /home/$USER/.local/share/Steam fi fi # Begin Josh Kilmer's (jkilmer)(srjek) dualmonitor script xrandr --output DVI-I-3 --off xrandr --auto xrandr --output DVI-I-3 --left-of DVI-I-2 xrandr --output DVI-I-2 --primary # End Josh Kilmer's (jkilmer)(srjek) dualmonitor script
#!/bin/bash # use bash for "exec -l", howto run login shell by /bin/sh ? if [ $# -eq 1 -a -n "$1" ]; then LXSESSION=$1 else # default session LXSESSION=/usr/bin/startlxde fi [ -f /etc/profile ] && . /etc/profile [ -f ~/.profile ] && . ~/.profile [ -f /etc/xprofile ] && . /etc/xprofile [ -f ~/.xprofile ] && . ~/.xprofile if [ -f /etc/X11/xinit/xinitrc-common ]; then # fedora . /etc/X11/xinit/xinitrc-common if ! [ -z "$XDG_SESSION_COOKIE" ]; then CK_XINIT_SESSION= elif [ -x /usr/bin/ck-launch-session -a -z "$CK_XINIT_SESSION" ]; then CK_XINIT_SESSION="/usr/bin/ck-launch-session" fi exec -l $SHELL -c "$CK_XINIT_SESSION \"$LXSESSION\"" elif [ -x /etc/X11/xinit/Xsession ]; then # fedora exec /etc/X11/xinit/Xsession "$LXSESSION" elif [ -x /etc/X11/Xsession ]; then # mandriva, debian, ubuntu exec /etc/X11/Xsession "$LXSESSION" elif [ -x /etc/X11/xinit/xinitrc ]; then #suse export WINDOWMANAGER=$LXSESSION exec -l $SHELL -c /etc/X11/xinit/xinitrc else # unknown, user should custom /etc/lxdm/xinitrc self if [ -x /etc/lxdm/xinitrc ]; then . /etc/lxdm/xinitrc fi if ! [ -z "$XDG_SESSION_COOKIE" ]; then CK_XINIT_SESSION= elif [ -x /usr/bin/ck-launch-session ]; then CK_XINIT_SESSION="/usr/bin/ck-launch-session" fi exec -l $SHELL -c "$CK_XINIT_SESSION \"$LXSESSION\"" fi
#!/bin/sh # # Note: this is a sample and will not be run as is.
Note the only files that were modified/related to this fix is:
Other files are documented solely for the purpose of completeness.
Other improvements can possibly be made, but that's for another time and day…
— Chase Lee 2013/04/27 02:19