-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·47 lines (41 loc) · 1.87 KB
/
Copy pathsetup.sh
File metadata and controls
executable file
·47 lines (41 loc) · 1.87 KB
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
#!/usr/bin/env bash
# One-shot installer for FeedMeSomePi on Raspberry Pi OS (Bullseye or Bookworm,
# 32-bit). Safe to re-run.
set -euo pipefail
cd "$(dirname "$0")"
echo "==> Installing system packages"
# python3-tk + python3-pil.imagetk : GUI + thumbnails.
# python3-lxml : Readability's parser — installing
# from apt avoids a slow source build
# on Pi Zero when pip installs
# readability-lxml below.
# alsa-utils : aplay, for the notify chime.
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
python3 python3-venv python3-pip \
python3-tk python3-pil.imagetk \
python3-lxml \
alsa-utils
echo "==> Creating virtualenv (.venv) with access to system site packages"
# --system-site-packages so we reuse the apt-installed python3-tk / python3-pil
# instead of pulling Pillow wheels (which build slowly on a Pi Zero).
python3 -m venv --system-site-packages .venv
echo "==> Installing Python deps"
. .venv/bin/activate
pip install --upgrade pip
pip install -r requirements.txt
echo "==> Installing desktop entry under the Internet menu"
# Categories=Network;News; lands the launcher in PiOS's "Internet" menu
# group. We substitute the absolute install path into the Exec= line so
# the launcher works no matter where the user cloned the repo.
desktop_src="assets/feedmesomepi.desktop.in"
desktop_dir="${XDG_DATA_HOME:-$HOME/.local/share}/applications"
mkdir -p "$desktop_dir"
sed "s|@INSTALL_DIR@|$PWD|g" "$desktop_src" \
> "$desktop_dir/feedmesomepi.desktop"
chmod 644 "$desktop_dir/feedmesomepi.desktop"
if command -v update-desktop-database >/dev/null 2>&1; then
update-desktop-database "$desktop_dir" >/dev/null 2>&1 || true
fi
echo
echo "Done. Launch FeedMeSomePi from the Internet menu, or run ./run.sh."