#!/bin/sh
# Xsetup - run as root before the login dialog appears

#==================================================================================
#added by Osukiss.

#----------------------------------------------------------------------------------
#set Keyboard Map (3 keyboard)
setxkbmap -layout "us,fr,ca"

#----------------------------------------------------------------------------------
#connect All Video CARD known from xrandr
CARD=`xrandr --listproviders | grep "Providers:" | grep "number" | cut -d ':' -f3`
num=1
while [ $num -lt $CARD ] ;
  do
  echo $num
  xrandr --setprovideroutputsource $num 0
  num=`echo $num + 1 | bc`
  done
#configuring screen
#xrandr --auto
#==================================================================================
#To configure multiscreen properly
# lets say command
#xrandr | grep ' connected'
# return following information
#	DVI-0 connected 1920x1200+0+0 (normal left inverted right x axis y axis) 519mm x 324mm
#	DVI-1 connected 1600x1200+1920+0 (normal left inverted right x axis y axis) 367mm x 275mm
#	DVI-D-1-1 connected 1680x1050+0+0 (normal left inverted right x axis y axis) 433mm x 270mm

#
# there is sddm login screen overlap between
# screen DVI-0 and DVI-D-1-1 (both with the same 0x0 offset)
# To fix this you can preset screen value
#
# Set proper value according your setup
#
export PRODSDDM="false"

if [ "$PRODSDDM" = "true" ] ; then
  #setting SDDM multiple screen without overlap
  xrandr							\
	--output DVI-D-1-1	--mode 1680x1050 --pos 0x0	\
	--output DVI-0		--mode 1920x1200 --pos 1680x0	\
	--output DVI-1		--mode 1600x1200 --pos 3600x0	\
	--rotate normal
  fi
