aboutsummaryrefslogtreecommitdiffstats
path: root/bin/screensetup
blob: b15d63e3aeb4e15c6af8da3b49de477ad620aa99 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/bash

#set dpms and screen blanking
xset +dpms
xset s 360 360

# Setup screens

# get info from xrandr
IFS=$'\r\n' connectedOutputs=($(xrandr | grep " connected" | sed -e "s/\([A-Z0-9]\+\) connected.*/\1/"))

#if more than one screen, setup both, using the external left of the internal as primary
if [ ${#connectedOutputs[@]} -gt 1 ]; then
  xrandr --output "${connectedOutputs[0]}" --auto --output "${connectedOutputs[1]}" --auto --primary --left-of "${connectedOutputs[0]}"
fi