-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexternscreen
executable file
·33 lines (29 loc) · 1.03 KB
/
externscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/bash
dir=$(dirname $0)
. ${dir}/echoex.sh
if [[ "$1" == "--help" || "$1" == "-h" ]]; then
echoex -green "Path: " -r $0 -n
echoex -green "Descript: " -r "change the size of extern screen to 1024x768" -n
echoex -green Usage: -r -n
echo " $(basename $0) set the extern screen size to 1280x1024"
echo " $(basename $0) --off turn off extern screen manual"
exit 0
fi
if [[ "$1" == "--off" ]]; then
xrandr --output VGA1 --off
exit 0
fi
test_VGA1=$(xrandr | grep 'VGA1 disconnected')
test_1280x1024=$(xrandr | grep '1280x1024_75.00')
if [ -z "$test_VGA1" ]; then
echo VGA connected, changing display mode
if [ -z "$test_1280x1024" ]; then
echo add mode 1280x1024_75.00
xrandr --newmode "1280x1024_75.00" 138.75 1280 1368 1504 1728 1024 1027 1034 1072 -hsync +vsync
xrandr --addmode VGA1 "1280x1024_75.00"
fi
xrandr --output LVDS1 --mode 1366x768 --output VGA1 --mode 1280x1024_75.00 --right-of LVDS1
echo display mode changed
else
echo VGA not connected, please connect another screen first
fi