<message>Update the cloud-init scripts to improve GTK theme settings by enforcing dark mode through gsettings and preserving the icon theme for a cohesive user experience. Additionally, enhance the first-boot script to install a Chromium kiosk launcher icon on the desktop and in the application menu, along with a five-tap close functionality for Chromium. These changes streamline the user interface and ensure a consistent dark theme across applications and the taskbar.
68 lines
2.9 KiB
Bash
Executable File
68 lines
2.9 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Revision: 2
|
|
# Sync portal (file server) content from the repo to the LXC.
|
|
# Updates /var/lib/cm4-provisioning/portal-files/ so first-boot and the
|
|
# dashboard /files/ serve the same scripts and assets as in the repo.
|
|
#
|
|
# Files first-boot.sh downloads from FILE_SERVER (../files/first-boot/):
|
|
# Required: start-chromium.sh, chromium-kiosk.desktop, splash.png,
|
|
# custom.plymouth, custom.script, 99-wallpaper.conf,
|
|
# 99-default-session.conf, maliit-keyboard.desktop
|
|
# One-shots (if ONESHOT_SCRIPTS set): <name>.sh + <name>.desktop
|
|
# e.g. 01-set-rotation-once.sh, 01-set-rotation-once.desktop,
|
|
# 02-set-wallpaper-once.sh, 02-set-wallpaper-once.desktop
|
|
# Optional: first-boot.conf (downloaded to /tmp by cloud-init runcmd)
|
|
# Note: splash.png is not in the repo; add it to plymouth-custom/ or upload
|
|
# via the portal if you want a custom boot splash.
|
|
#
|
|
# Usage: ./sync-portal-files-to-lxc.sh [user@lxc_ip]
|
|
# Example: ./sync-portal-files-to-lxc.sh root@10.130.60.141
|
|
|
|
set -e
|
|
LXC="${1:-root@10.130.60.141}"
|
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
REPO_DIR="$(dirname "$SCRIPT_DIR")"
|
|
CLOUDINIT_DIR="$REPO_DIR/cloud-init"
|
|
REMOTE_PORTAL="/var/lib/cm4-provisioning/portal-files"
|
|
REMOTE_FIRST_BOOT="${REMOTE_PORTAL}/first-boot"
|
|
|
|
if [[ ! -d "$CLOUDINIT_DIR" ]]; then
|
|
echo "Error: cloud-init dir not found: $CLOUDINIT_DIR"
|
|
exit 1
|
|
fi
|
|
|
|
echo "Syncing portal files to $LXC ($REMOTE_PORTAL) ..."
|
|
ssh "$LXC" "command -v rsync >/dev/null 2>&1 || (apt-get update -qq && apt-get install -y rsync)"
|
|
ssh "$LXC" "mkdir -p $REMOTE_FIRST_BOOT"
|
|
|
|
# --- Portal root (URL /files/...) ---
|
|
# first-boot.sh: cloud-init runcmd downloads this
|
|
rsync -avz "$CLOUDINIT_DIR/first-boot.sh" "$LXC:$REMOTE_PORTAL/"
|
|
# Optional config: cloud-init can download to /tmp/first-boot.conf before running first-boot.sh
|
|
rsync -avz "$CLOUDINIT_DIR/first-boot.conf.example" "$LXC:$REMOTE_PORTAL/"
|
|
[[ -f "$CLOUDINIT_DIR/first-boot.conf" ]] && rsync -avz "$CLOUDINIT_DIR/first-boot.conf" "$LXC:$REMOTE_PORTAL/" || true
|
|
|
|
# --- first-boot/ (URL /files/first-boot/...) ---
|
|
# Config files: LightDM, Maliit, Chromium kiosk, one-shot .desktop files
|
|
rsync -avz --exclude='README.md' \
|
|
"$CLOUDINIT_DIR/config-files/" \
|
|
"$LXC:$REMOTE_FIRST_BOOT/"
|
|
|
|
# Kiosk and scripts
|
|
rsync -avz \
|
|
"$CLOUDINIT_DIR/start-chromium.sh" \
|
|
"$CLOUDINIT_DIR/five-tap-close-chromium.py" \
|
|
"$CLOUDINIT_DIR/01-set-rotation-once.sh" \
|
|
"$CLOUDINIT_DIR/02-set-wallpaper-once.sh" \
|
|
"$CLOUDINIT_DIR/set-rotation-at-login.sh" \
|
|
"$CLOUDINIT_DIR/fix-reterminal-display.sh" \
|
|
"$LXC:$REMOTE_FIRST_BOOT/"
|
|
|
|
# Plymouth theme (custom.plymouth, custom.script; add splash.png to this dir or upload via portal)
|
|
rsync -avz \
|
|
"$CLOUDINIT_DIR/files-from-guard/plymouth-custom/" \
|
|
"$LXC:$REMOTE_FIRST_BOOT/"
|
|
|
|
echo "Done. Portal files at http://$(echo "$LXC" | cut -d@ -f2):5000/files/"
|
|
echo "Note: Add splash.png to $REMOTE_FIRST_BOOT/ (or plymouth-custom/) if you want a custom boot splash."
|