Skip to content

Commit 6cbf991

Browse files
committed
added BETA scripts for Arch Linux
1 parent 13e5c19 commit 6cbf991

File tree

4 files changed

+107
-0
lines changed

4 files changed

+107
-0
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/bin/bash
2+
3+
# Install X-Server and Openbox
4+
sudo pacman -S xorg-server xorg-xinit xorg-server-xvfb xterm openbox unclutter
5+
6+
# Add Openbox to X-Server autostart
7+
cd $HOME
8+
echo "exec openbox-session" >> .xinitrc
9+
10+
# Copy some Openbox settings
11+
mkdir -p $HOME/.config/openbox
12+
cp /etc/xdg/openbox/rc.xml $HOME/.config/openbox/
13+
cp /etc/xdg/openbox/menu.xml $HOME/.config/openbox/
14+
wget https://raw.githubusercontent.com/SEPIA-Framework/sepia-installation-and-setup/master/sepia-client-installation/rpi/openbox
15+
mv openbox $HOME/.config/openbox/autostart.sh
16+
17+
# Install Chromium with SEPIA extension and user folder
18+
sudo pacman -S chromium
19+
mkdir -p $HOME/sepia-client/chromium
20+
mkdir -p $HOME/sepia-client/chromium-extensions/sepia-fw
21+
cd $HOME/sepia-client
22+
mkdir -p tmp
23+
git clone --single-branch -b master https://github.com/SEPIA-Framework/sepia-browser-extensions tmp/sepia-client-browser-ex-git
24+
mv tmp/sepia-client-browser-ex-git/chromium/* ~/sepia-client/chromium-extensions/sepia-fw/
25+
rm -rf tmp/sepia-client-browser-ex-git
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/bash
2+
3+
sudo pacman -S curl wget nano zip unzip git procps-ng inetutils gcc make espeak-ng ca-certificates openssl jre11-openjdk-headless
4+
wget https://raw.githubusercontent.com/MadameMalady/Manjaro-Phosh-Arm-Sepia-Installer/main/sepia-installer.sh
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/bin/bash
2+
3+
cd $HOME
4+
mkdir -p sepia-stt
5+
git clone --single-branch --depth 1 -b master https://github.com/SEPIA-Framework/sepia-stt-server.git
6+
mv sepia-stt-server/src sepia-stt/server
7+
rm -rf sepia-stt-server
8+
cd $HOME/sepia-stt
9+
10+
sudo pacman -S python-pip python-setuptools python-wheel libffi
11+
pip3 install cffi fastapi uvicorn[standard] aiofiles
12+
wget https://github.com/alphacep/vosk-api/releases/download/v0.3.32/vosk-0.3.32-py3-none-linux_aarch64.whl
13+
pip3 install vosk-0.3.32-py3-none-linux_aarch64.whl
14+
15+
mkdir -p models
16+
mkdir -p downloads
17+
cd downloads
18+
wget https://github.com/SEPIA-Framework/sepia-stt-server/releases/download/v0.9.5/vosk-model-small-en-us-0.15.zip
19+
wget https://github.com/SEPIA-Framework/sepia-stt-server/releases/download/v0.9.5/vosk-model-small-de-0.15.zip
20+
wget https://github.com/SEPIA-Framework/sepia-stt-server/releases/download/v0.9.5/vosk-model-spk-0.4.zip
21+
unzip vosk-model-small-en-us-0.15.zip && mv vosk-model-small-en-us-0.15 ../models/vosk-model-small-en-us
22+
unzip vosk-model-small-de-0.15.zip && mv vosk-model-small-de-0.15 ../models/vosk-model-small-de
23+
unzip vosk-model-spk-0.4.zip && mv vosk-model-spk-0.4 ../models/vosk-model-spk
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
#!/bin/bash
2+
LOG="$(dirname "$SCRIPT_PATH")""/log-run.out"
3+
LOG_CLIENT="/dev/null"
4+
echo "$(date +'%Y_%m_%d_%H:%M:%S') - Log file: $LOG" >> "$LOG"
5+
6+
is_headless=0
7+
8+
# Source and XServer check
9+
script_source=""
10+
is_xserver_running=0
11+
if [ -n "$1" ]; then
12+
script_source=$1
13+
fi
14+
if [ "$script_source" = "xserver" ] || [ -n "$DISPLAY" ]; then
15+
is_xserver_running=1
16+
fi
17+
if [ "$is_xserver_running" -eq "0" ]; then
18+
if [ "$is_headless" -eq "0" ] || [ "$is_headless" -eq "2" ]; then
19+
if [[ ! $DISPLAY && $XDG_VTNR -eq 1 ]]; then
20+
# On device call
21+
echo "Starting X-Server to support display ..."
22+
echo "$(date +'%Y_%m_%d_%H:%M:%S') - Starting X-Server to support display ..." >> "$LOG"
23+
startx
24+
exit
25+
else
26+
# Call from SSH terminal
27+
echo "Cannot start client in display-mode via SSH terminal (no X-Server support)."
28+
echo "Please use reboot + auto-login or call directly on device."
29+
echo "$(date +'%Y_%m_%d_%H:%M:%S') - Cannot start client in display-mode via SSH terminal (no X-Server support) - Use reboot + auto-login or call directly on device." >> "$LOG"
30+
exit
31+
fi
32+
fi
33+
fi
34+
35+
# Start Chromium in kiosk mode
36+
echo "$(date +'%Y_%m_%d_%H:%M:%S') - Preparing Chromium ..." >> "$LOG"
37+
client_url="http://localhost:20721/app/index.html"
38+
39+
chromedatadir=~/sepia-client/chromium
40+
if [ -f "$chromedatadir/Default/Preferences" ]; then
41+
echo "$(date +'%Y_%m_%d_%H:%M:%S') - Setting default preferences for Chromium (permissions: mic, location, notifications)" >> "$LOG"
42+
sed -i 's/"exited_cleanly":false/"exited_cleanly":true/' $chromedatadir/'Local State'
43+
sed -i 's/"exited_cleanly":false/"exited_cleanly":true/; s/"exit_type":"[^"]\+"/"exit_type":"Normal"/' $chromedatadir/Default/Preferences
44+
sed -i 's/"notifications":{}/"notifications":{"http:\/\/localhost:8080,*":{"last_modified":"13224291659276737","setting":1}}/' $chromedatadir/Default/Preferences
45+
sed -i 's/"geolocation":{}/"geolocation":{"http:\/\/localhost:8080,http:\/\/localhost:8080":{"last_modified":"13224291716729005","setting":1}}/' $chromedatadir/Default/Preferences
46+
sed -i 's/"media_stream_mic":{}/"media_stream_mic":{"http:\/\/localhost:8080,*":{"last_modified":"13224291643099497","setting":1}}/' $chromedatadir/Default/Preferences
47+
else
48+
echo "$(date +'%Y_%m_%d_%H:%M:%S') - Could not set default preferences for Chromium (yet?) - Please restart client once more and check if 'chromium/Default/Preferences' was created." >> "$LOG"
49+
fi
50+
51+
default_chrome_flags="--user-data-dir=$chromedatadir --allow-insecure-localhost --autoplay-policy=no-user-gesture-required --disable-infobars --enable-features=OverlayScrollbar --hide-scrollbars --no-default-browser-check --check-for-update-interval=31536000"
52+
chrome_extensions="--load-extension=~/sepia-client/chromium-extensions/sepia-fw"
53+
54+
echo "Running SEPIA-Client in 'display' mode. Use SEPIA Control-HUB to connect and control via remote terminal, default URL is: $clexi_ws_url"
55+
chromium $default_chrome_flags $chrome_extensions --kiosk "$client_url?isApp=true&hasTouch=true" >"$LOG_CLIENT" 2>&1

0 commit comments

Comments
 (0)