File tree Expand file tree Collapse file tree 1 file changed +40
-0
lines changed Expand file tree Collapse file tree 1 file changed +40
-0
lines changed Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env sh
2
+
3
+ set -x
4
+
5
+ ACTIVATE=$1
6
+ WIDTH=$2
7
+ HEIGHT=$3
8
+
9
+ RESOLUTION_FILE=" /etc/X11/xorg.conf.d/resolution.conf"
10
+
11
+ run_xrandr () {
12
+ if get_os2borgerpc_config os2_product | grep --quiet kiosk; then
13
+ USR=" chrome"
14
+ else
15
+ USR=" user"
16
+ fi
17
+
18
+ export DISPLAY=:0
19
+ export XAUTHORITY=/home/$USR /.Xauthority
20
+ echo " The valid resolutions are shown on the left in the list below:"
21
+ xrandr
22
+ }
23
+
24
+ if [ " $2 " != " " ] && [ " $ACTIVATE " = " True" ]; then
25
+ # Make sure the folder exists
26
+ mkdir --parents " $( dirname $RESOLUTION_FILE ) "
27
+
28
+ # Write the .conf-file
29
+ cat << EOF > $RESOLUTION_FILE
30
+ Section "Screen"
31
+ Identifier "Screen0"
32
+ Subsection "Display"
33
+ Modes "${WIDTH} x${HEIGHT} "
34
+ EndSubSection
35
+ EndSection
36
+ EOF
37
+ elif [ " $ACTIVATE " = " False" ]; then
38
+ rm --force $RESOLUTION_FILE
39
+ fi
40
+ run_xrandr
You can’t perform that action at this time.
0 commit comments