Skip to content

Commit d8138fa

Browse files
mfxaAndreas Poulsen
authored andcommitted
Print out xrandr information for both kiosk and borgerpc
...and leave the second argument empty to only list options without making changes
1 parent d380e19 commit d8138fa

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

common/system/change_resolution.sh

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env bash
1+
#!/usr/bin/env sh
22

33
set -x
44

@@ -8,7 +8,20 @@ HEIGHT=$3
88

99
RESOLUTION_FILE="/etc/X11/xorg.conf.d/resolution.conf"
1010

11-
if [ "$ACTIVATE" = "True" ]; then
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
1225
# Make sure the folder exists
1326
mkdir --parents "$(dirname $RESOLUTION_FILE)"
1427

@@ -21,8 +34,8 @@ Section "Screen"
2134
EndSubSection
2235
EndSection
2336
EOF
37+
elif [ "$ACTIVATE" = "True" ]; then
38+
run_xrandr && exit
2439
else
2540
rm --force $RESOLUTION_FILE
2641
fi
27-
echo "The valid resolutions are shown on the left in the list below:"
28-
xrandr

0 commit comments

Comments
 (0)