forked from Sergey1560/fb_st7796s
-
Notifications
You must be signed in to change notification settings - Fork 6
/
switch_to_landscape.sh
executable file
·42 lines (29 loc) · 1.37 KB
/
switch_to_landscape.sh
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
#!/bin/bash
##### Please note this script is still under development
##### Внимание! Скрипт в стадии разработки и тестирования
##### inspired by mo5 (https://t.me/Ogmins, https://telegra.ph/kliperscreen-04-08 )
##### This script should be installed AFTER install.sh
die() { echo "$*" 1>&2 ; exit 1; }
SCRIPT=$(realpath "$0")
SPATH=$(dirname "$SCRIPT")
echo "Check kernel architecture..."
UN=`uname -a`
#armbian, https://www.armbian.com/orangepi3-lts/
echo "$UN" | grep sunxi64 && LHEADERS=linux-headers-current-sunxi64
echo "$UN" | grep sunxi64 && OVL=armbian-add-overlay
#debian, https://github.com/silver-alx/sbc/releases
echo "$UN" | grep sun50iw6 && LHEADERS=linux-headers-next-sun50iw6
echo "$UN" | grep sun50iw6 && OVL=orangepi-add-overlay
#workaround for kernel 5.10.76
echo "$UN" | grep 5.10.76-sun50iw6 && LHEADERS=linux-headers-current-sun50iw6
[ ! -z "$LHEADERS" ] || die "Unknown kernel architecture"
cd $SPATH
echo "Installing overlay..."
cp $SPATH/dts/sun50i-h6-st7796s-landscape.dts /tmp/sun50i-h6-st7796s.dts
sudo $OVL /tmp/sun50i-h6-st7796s.dts || die "Error installing overlay"
echo "Copying xorg.conf rules..."
sudo systemctl stop KlipperScreen.service
sudo rm /etc/X11/xorg.conf.d/51*
sudo rm /etc/X11/xorg.conf.d/52*
sudo cp $SPATH/X11/xorg.conf.d/52* /etc/X11/xorg.conf.d
echo "Your need reboot your SBC to activate module"