-
Notifications
You must be signed in to change notification settings - Fork 0
/
xprofile
executable file
·26 lines (24 loc) · 1.08 KB
/
xprofile
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
#!/bin/sh
# This file persists high resolution on Ubuntu during login. Same commands need
# to be run to add new resolution to Ubuntu at runtime. To get config inputs, we
# need to run 2 commands.
# $ xrandr | grep "connected primary" // gives 'display device name'
# Then get newmode, addmode inputs by running 'cvt' with input of new resolution
# $ cvt 1400 900
# # 1400x900 59.96 Hz (CVT) hsync: 56.01 kHz; pclk: 103.50 MHz
# # Modeline "1400x900_60.00" 103.50 1400 1480 1624 1848 900 903 913 934 -hsync +vsync
disps=$(xrandr | grep -w connected | awk '{print $1}')
R1080P_NAME="1920x1080_60.00"
R1080P_ARGS="173.00 1920 2048 2248 2576 1080 1083 1088 1120 -hsync +vsync"
R1600P_NAME="1600x900_60.00"
R1600P_ARGS="118.25 1600 1696 1856 2112 900 903 908 934 -hsync +vsync"
for d in $disps; do
case $d in
'HDMI-2') RMODE=$R1080P_NAME; RARGS=$R1080P_ARGS; ;;
'eDP-1') RMODE=$R1600P_NAME; RARGS=$R1600P_ARGS; ;;
esac
#echo "change resolution of $d to $RMODE $RARGS";
xrandr --newmode $RMODE $RARGS
xrandr --addmode $d $RMODE
xrandr --output $d --mode $RMODE
done