forked from moode-player/moode
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathxinitrc.default
executable file
·56 lines (50 loc) · 1.98 KB
/
xinitrc.default
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/bin/bash
#
# SPDX-License-Identifier: GPL-3.0-or-later
# Copyright 2014 The moOde audio player project / Tim Curtis
#
# Turn off display power management
xset -dpms
# Screensaver timeout in secs or 'off' for no timeout
xset s 600
# Capture native screen size
fgrep "#dtoverlay=vc4-kms-v3d" /boot/firmware/config.txt
if [ $? -ne 0 ]; then
SCREEN_RES=$(kmsprint | awk '$1 == "FB" {print $3}' | awk -F"x" '{print $1","$2}')
else
SCREEN_RES=$(fbset -s | awk '$1 == "geometry" {print $2","$3}')
fi
# Set HDMI/DSI screen orientation
HDMI_SCN_ORIENT=$(moodeutl -q "SELECT value FROM cfg_system WHERE param='hdmi_scn_orient'")
DSI_SCN_TYPE=$(moodeutl -q "SELECT value FROM cfg_system WHERE param='dsi_scn_type'")
DSI_PORT=$(moodeutl -q "SELECT value FROM cfg_system WHERE param='dsi_port'")
DSI_SCN_ROTATE=$(moodeutl -q "SELECT value FROM cfg_system WHERE param='dsi_scn_rotate'")
if [ $DSI_SCN_TYPE = 'none' ]; then
if [ $HDMI_SCN_ORIENT = "portrait" ]; then
SCREEN_RES=$(echo $SCREEN_RES | awk -F"," '{print $2","$1}')
DISPLAY=:0 xrandr --output HDMI-1 --rotate left
fi
elif [ $DSI_SCN_TYPE = '2' ]; then
if [ $DSI_SCN_ROTATE = "0" ]; then
DISPLAY=:0 xrandr --output DSI-$DSI_PORT --rotate normal
elif [ $DSI_SCN_ROTATE = "90" ]; then
SCREEN_RES=$(echo $SCREEN_RES | awk -F"," '{print $2","$1}')
DISPLAY=:0 xrandr --output DSI-$DSI_PORT --rotate right
elif [ $DSI_SCN_ROTATE = "180" ]; then
DISPLAY=:0 xrandr --output DSI-$DSI_PORT --rotate inverted
elif [ $DSI_SCN_ROTATE = "270" ]; then
SCREEN_RES=$(echo $SCREEN_RES | awk -F"," '{print $2","$1}')
DISPLAY=:0 xrandr --output DSI-$DSI_PORT --rotate left
fi
fi
# Clear browser cache
$(/var/www/util/sysutil.sh clearbrcache)
# Launch chromium browser
chromium-browser --app="http://localhost/" \
--window-size="$SCREEN_RES" \
--window-position="0,0" \
--enable-features="OverlayScrollbar" \
--no-first-run \
--disable-infobars \
--disable-session-crashed-bubble \
--kiosk