forked from ddvk/remarkable-autoinstall
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathauto.sh
executable file
·49 lines (41 loc) · 1.07 KB
/
auto.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
43
44
45
46
47
48
49
set -e
APPDIR=${APPDIR:-/home/root/apps}
REPOURL="https://raw.githubusercontent.com/ddvk/remarkable-autoinstall"
mkdir -p $APPDIR
mkdir -p ~/.config/draft
mkdir -p ~/scripts
mkdir -p ~/edit
systemctl stop touchinjector || true
echo "Downloading files..."
wget "$REPOURL/master/scripts/swipeup.sh" -O ~/scripts/swipeup.sh
apps=( draft edit touchinjector fingerterm )
for app in "${apps[@]}"
do
wget "$REPOURL/master/apps/$app" -O $APPDIR/$app
done
echo "Downloading draft configs..."
cfgs=( 03-edit 05-fingerterm )
for cfg in "${cfgs[@]}"
do
wget "$REPOURL/master/.config/draft/$cfg" -O ~/.config/draft/$cfg
done
echo "Setting exec permissions"
for f in $APPDIR/*; do
chmod +x $f
done
chmod +x ~/scripts/swipeup.sh
echo "Systemd unit file"
cat << EOF > /etc/systemd/system/touchinjector.service
[Unit]
Description=touch injector
After=home.mount
[Service]
Environment=HOME=/home/root
ExecStart=$APPDIR/touchinjector
[Install]
WantedBy=multi-user.target
EOF
systemctl daemon-reload
systemctl enable touchinjector
systemctl start touchinjector
echo "Started touch gestures"