2 # Copyright (C) 2016 Ian Kelling
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
8 # http://www.apache.org/licenses/LICENSE-2.0
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
16 # first 2 alternatives showed under ubuntu 14.04, second 2 under arch at 11/2015
19 right_monitor_rotation
=left
21 right_monitor_rotation
=normal
26 xe
() { echo "$xout"; }
27 x
=$
(xe |
grep -E '^(DisplayPort-[0123]|DVI-0|DP-[1234]|DVI-I-1) connected' |
wc -l)
29 left
=$
(xe |
sed -rn 's/^(DVI[^ ]+) connected .*/\1/p')
30 dps
=( $
(xe |
sed -rn 's/^(DP-[01234]|DisplayPort-[01234]) connected .*/\1/p') )
34 # on older distros, i needed to swap middle and right.
37 xrandr
--output $left --mode 2560x1600
--pos 0x0 --rotate left \
38 --output $middle --mode 2560x1600
--pos 1600x0
--rotate left \
39 --output $right --mode 2560x1600
--pos 3200x0
--rotate $right_monitor_rotation
40 elif (( x
== 2 )); then
41 # 3rd monitor not working atm, so doing this.
42 left
=$
(xe |
sed -rn 's/^(DVI[^ ]+) connected .*/\1/p')
43 middle
=$
(xe |
sed -rn 's/^(DP-[01234]|DisplayPort-[01234]) connected .*/\1/p')
44 xrandr
--output $left --mode 2560x1600
--pos 0x0 --rotate left \
45 --output $middle --mode 2560x1600
--pos 1600x0
--rotate left
48 /a
/bin
/distro-setup
/input-setup m
54 date "+%A, %B %d, %r, %S seconds" > /tmp
/desktop-20-autostart-log