From a2b614c2ff142b4bcb630acc20d3f34cd2f1b5e1 Mon Sep 17 00:00:00 2001 From: Alejandro Mora Date: Fri, 10 Apr 2026 20:35:29 -0400 Subject: [PATCH 1/3] =?UTF-8?q?feat(themes):=20=E2=9C=A8=20add=20theme=20i?= =?UTF-8?q?nstaller?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Publish a new package that contains all the themes in the repo for easy installing. This way we can quicky swap them around as needed without having to struggle to download them manually. --- README.md | 30 ++- debian/control | 8 + debian/lcd4linux-ax206-themes.install | 3 + debian/lcd4linux-ax206.dirs | 1 + debian/lcd4linux-ax206.service | 3 +- debian/rules | 1 + lcd4linux-theme | 174 ++++++++++++++++++ themes/README.md | 17 +- .../dpf_simpleorangefall.conf | 4 +- 9 files changed, 234 insertions(+), 7 deletions(-) create mode 100644 debian/lcd4linux-ax206-themes.install create mode 100644 debian/lcd4linux-ax206.dirs create mode 100644 lcd4linux-theme diff --git a/README.md b/README.md index ef50a0b..add7d9d 100644 --- a/README.md +++ b/README.md @@ -72,12 +72,17 @@ sudo pkg install lcd4linux-ax206 ### What gets installed -**Linux:** +**Linux (`lcd4linux-ax206`):** - `/usr/bin/lcd4linux` — the binary - `/etc/lcd4linux/lcd4linux.conf` — default configuration (320x240 DPF layout) - `/etc/lcd4linux/examples/` — additional example configs - `lcd4linux-ax206.service` — systemd service unit +**Linux (`lcd4linux-ax206-themes`, optional):** +- `/usr/bin/lcd4linux-theme` — theme management CLI +- `/usr/share/lcd4linux/themes/` — 39 pre-built themes +- `/usr/share/lcd4linux/fonts/` — bundled TrueType fonts + **FreeBSD:** - `/usr/local/bin/lcd4linux` — the binary - `/usr/local/etc/lcd4linux/lcd4linux.conf` — default configuration @@ -230,10 +235,29 @@ See [AX206 Fork Features](https://github.com/amd989/lcd4linux-ax206/wiki/ax206_f **[Browse the Theme Gallery →](themes/README.md)** -To use a theme, point lcd4linux at its config file: +### Using themes after installation + +Install the themes package, then use the `lcd4linux-theme` CLI: + +```bash +sudo apt install lcd4linux-ax206-themes + +# List all available themes +lcd4linux-theme list + +# Apply a theme (backs up your current config automatically) +sudo lcd4linux-theme apply SimpleBlue + +# Check what's currently active +lcd4linux-theme current +``` + +### Using themes from source + +Point lcd4linux directly at the config file from the repository root: ```bash -lcd4linux -F -c themes/SimpleWhite/dpf_simplewhite.conf +./lcd4linux -F -f themes/SimpleWhite/dpf_simplewhite.conf ``` Original theme designs from [turing-smart-screen-python](https://github.com/mathoudebine/turing-smart-screen-python), adapted for lcd4linux. Theme authors: [@takattila](https://github.com/takattila), [@mathoudebine](https://github.com/mathoudebine), [@napobear](https://github.com/napobear), [@amiltonjr](https://github.com/amiltonjr). Licensed under GPL-3.0. diff --git a/debian/control b/debian/control index 364982a..9543fea 100644 --- a/debian/control +++ b/debian/control @@ -27,3 +27,11 @@ Description: LCD display driver for AX206 USB displays . Features include pixel-level brightness control, VNC mirror display support, TrueType font rendering, and graphical bar widgets with color thresholds. + +Package: lcd4linux-ax206-themes +Architecture: all +Depends: lcd4linux-ax206, ${misc:Depends} +Description: Themes and fonts for lcd4linux-ax206 + Collection of 39 pre-built themes with background images and TrueType fonts + for AX206 USB LCD displays. Includes a theme management CLI (lcd4linux-theme) + for easy theme switching. diff --git a/debian/lcd4linux-ax206-themes.install b/debian/lcd4linux-ax206-themes.install new file mode 100644 index 0000000..a9b7017 --- /dev/null +++ b/debian/lcd4linux-ax206-themes.install @@ -0,0 +1,3 @@ +lcd4linux-theme usr/bin +themes usr/share/lcd4linux +fonts usr/share/lcd4linux diff --git a/debian/lcd4linux-ax206.dirs b/debian/lcd4linux-ax206.dirs new file mode 100644 index 0000000..fb55a98 --- /dev/null +++ b/debian/lcd4linux-ax206.dirs @@ -0,0 +1 @@ +usr/share/lcd4linux diff --git a/debian/lcd4linux-ax206.service b/debian/lcd4linux-ax206.service index 76c8c04..26e4535 100644 --- a/debian/lcd4linux-ax206.service +++ b/debian/lcd4linux-ax206.service @@ -4,7 +4,8 @@ After=network.target [Service] Type=simple -ExecStartPre=/bin/sh -c 'test -f /etc/lcd4linux/lcd4linux.conf || { echo "No config found. Copy an example: sudo cp /etc/lcd4linux/examples/dpf_320x240.conf /etc/lcd4linux/lcd4linux.conf"; exit 1; }' +WorkingDirectory=/usr/share/lcd4linux +ExecStartPre=/bin/sh -c 'test -f /etc/lcd4linux/lcd4linux.conf || { echo "No config found. Run: sudo lcd4linux-theme apply SimpleBlue"; exit 1; }' ExecStart=/usr/bin/lcd4linux -F -f /etc/lcd4linux/lcd4linux.conf Restart=on-failure RestartSec=10 diff --git a/debian/rules b/debian/rules index ff056d5..07d5c7b 100755 --- a/debian/rules +++ b/debian/rules @@ -21,6 +21,7 @@ override_dh_auto_install: override_dh_install: dh_install install -D -m 0644 dpf_320x240.conf debian/lcd4linux-ax206/etc/lcd4linux/lcd4linux.conf + chmod 0755 debian/lcd4linux-ax206-themes/usr/bin/lcd4linux-theme override_dh_auto_clean: [ ! -f Makefile ] || dh_auto_clean diff --git a/lcd4linux-theme b/lcd4linux-theme new file mode 100644 index 0000000..8b59463 --- /dev/null +++ b/lcd4linux-theme @@ -0,0 +1,174 @@ +#!/bin/sh +# lcd4linux-theme — theme manager for lcd4linux-ax206 +set -e + +VERSION="1.0.0" +DATA_DIR=/usr/share/lcd4linux +THEMES_DIR="$DATA_DIR/themes" +CONFIG_FILE=/etc/lcd4linux/lcd4linux.conf +CONFIG_DIR=/etc/lcd4linux +MARKER_FILE="$CONFIG_DIR/.current-theme" +SERVICE_NAME=lcd4linux-ax206 + +get_description() { + case "$1" in + Cyberdeck) echo "Multi-gauge: CPU, GPU, RAM, fan, FPS, network" ;; + Cyberpunk) echo "Cyberpunk 2077-styled system monitor" ;; + Cyberpunk-net) echo "Cyberpunk variant with download/upload speeds" ;; + LandscapeEarth) echo "Earth-themed: CPU, GPU, RAM bars, temperature" ;; + LandscapeMagicBlue) echo "Sci-fi: 4 radial gauges, network, disk usage" ;; + LandscapeModernDevice35) echo "Server dashboard: sparklines, memory, disk, uptime" ;; + NAS) echo "4-bay NAS: drive usage, size, temperature" ;; + OPNSense) echo "OPNSense: network traffic, firewall, system health" ;; + SimpleBlue) echo "Blue: CPU, RAM, GPU, temperature" ;; + SimpleBlueFall) echo "Blue, alternate background" ;; + SimpleBlueGauge) echo "Blue with radial arc gauges" ;; + SimpleCyberpunkGauge) echo "Cyberpunk-styled radial gauges" ;; + SimpleFire) echo "Fire-themed system monitor" ;; + SimpleFireGauge) echo "Fire-themed radial gauges" ;; + SimpleGreen) echo "Green: CPU, RAM, GPU, temperature" ;; + SimpleGreenFall) echo "Green, alternate background" ;; + SimpleGreenGauge) echo "Green with radial arc gauges" ;; + SimpleMulticolor) echo "Multi-color variant" ;; + SimpleNeon) echo "Neon-lit system monitor" ;; + SimpleNeonGauge) echo "Neon radial gauges" ;; + SimpleOrange) echo "Orange: CPU, RAM, GPU, temperature" ;; + SimpleOrangeFall) echo "Orange, alternate background" ;; + SimpleOrangeGauge) echo "Orange with radial arc gauges" ;; + SimplePurple) echo "Purple: CPU, RAM, GPU, temperature" ;; + SimplePurpleFall) echo "Purple, alternate background" ;; + SimplePurpleGauge) echo "Purple with radial arc gauges" ;; + SimpleRed) echo "Red: CPU, RAM, GPU, temperature" ;; + SimpleRedFall) echo "Red, alternate background" ;; + SimpleRedGauge) echo "Red with radial arc gauges" ;; + SimpleRedGaugeRedBg) echo "Red gauges with red background" ;; + SimpleWhite) echo "White: CPU, RAM, GPU, temperature" ;; + SimpleWhite-FreeBSD) echo "White (FreeBSD variant)" ;; + SimpleWhiteNas) echo "White 4-bay NAS: usage, size, temp sparkline" ;; + SimpleWhiteNasIO) echo "White 4-bay NAS: usage, temp, I/O sparkline" ;; + SimpleYellow) echo "Yellow: CPU, RAM, GPU, temperature" ;; + SimpleYellowFall) echo "Yellow, alternate background" ;; + SimpleYellowGauge) echo "Yellow with radial arc gauges" ;; + bash-dark-green) echo "Terminal green-on-black: CPU, RAM, network, disk" ;; + bash-dark-green-gpu) echo "Terminal green-on-black with GPU stats" ;; + *) echo "" ;; + esac +} + +find_theme_conf() { + for f in "$THEMES_DIR/$1"/*.conf; do + [ -f "$f" ] && echo "$f" && return + done +} + +require_root() { + if [ "$(id -u)" -ne 0 ]; then + echo "Error: 'lcd4linux-theme apply' requires root privileges." >&2 + echo "Try: sudo lcd4linux-theme apply $1" >&2 + exit 1 + fi +} + +cmd_list() { + if [ ! -d "$THEMES_DIR" ]; then + echo "No themes directory found at $THEMES_DIR" >&2 + echo "Install the lcd4linux-ax206-themes package." >&2 + exit 1 + fi + + echo "Available themes:" + echo "" + for dir in "$THEMES_DIR"/*/; do + [ -d "$dir" ] || continue + name=$(basename "$dir") + conf=$(find_theme_conf "$name") + [ -n "$conf" ] || continue + desc=$(get_description "$name") + printf " %-28s %s\n" "$name" "$desc" + done + echo "" + echo "Use 'sudo lcd4linux-theme apply ' to activate a theme." +} + +cmd_current() { + if [ ! -f "$CONFIG_FILE" ]; then + echo "No configuration file found at $CONFIG_FILE" + exit 1 + fi + if [ -f "$MARKER_FILE" ]; then + theme=$(cat "$MARKER_FILE") + echo "Current theme: $theme" + if [ "$CONFIG_FILE" -nt "$MARKER_FILE" ]; then + echo " (config has been modified since theme was applied)" + fi + else + echo "No theme applied. Configuration may be manually managed." + fi +} + +cmd_apply() { + theme_name="$1" + if [ -z "$theme_name" ]; then + echo "Error: Missing theme name." >&2 + echo "Usage: lcd4linux-theme apply " >&2 + echo "Run 'lcd4linux-theme list' to see available themes." >&2 + exit 1 + fi + + require_root "$theme_name" + + if [ ! -d "$THEMES_DIR/$theme_name" ]; then + echo "Error: Theme '$theme_name' not found." >&2 + echo "Run 'lcd4linux-theme list' to see available themes." >&2 + exit 1 + fi + + conf=$(find_theme_conf "$theme_name") + if [ -z "$conf" ]; then + echo "Error: No config file found in theme '$theme_name'." >&2 + exit 1 + fi + + # Backup existing config if it differs + if [ -f "$CONFIG_FILE" ]; then + if ! cmp -s "$conf" "$CONFIG_FILE"; then + backup="$CONFIG_FILE.bak.$(date +%Y%m%d-%H%M%S)" + cp "$CONFIG_FILE" "$backup" + echo "Backed up current config to $backup" + fi + fi + + # Install new config + mkdir -p "$CONFIG_DIR" + cp "$conf" "$CONFIG_FILE" + echo "$theme_name" > "$MARKER_FILE" + echo "Applied theme: $theme_name" + + # Restart service if active + if systemctl is-active --quiet "$SERVICE_NAME" 2>/dev/null; then + systemctl restart "$SERVICE_NAME" + echo "Service restarted." + else + echo "Start the service with: sudo systemctl start $SERVICE_NAME" + fi +} + +usage() { + cat < Apply a theme (requires root) + lcd4linux-theme current Show the current theme + lcd4linux-theme help Show this help message +EOF +} + +case "${1:-help}" in + list) cmd_list ;; + apply) shift; cmd_apply "$@" ;; + current) cmd_current ;; + help|--help|-h) usage ;; + *) echo "Unknown command: $1" >&2; usage; exit 1 ;; +esac diff --git a/themes/README.md b/themes/README.md index c4e75f5..5e0be22 100644 --- a/themes/README.md +++ b/themes/README.md @@ -2,7 +2,22 @@ 35+ ready-to-use themes for the AX206 3.5" USB display. Each folder contains a `.conf` file and a `preview.png`. -To use a theme, point lcd4linux at its config file: +## Applying a Theme + +**If you installed the `lcd4linux-ax206-themes` package**, use the `lcd4linux-theme` CLI: + +```bash +# List all available themes +lcd4linux-theme list + +# Apply a theme (backs up your current config automatically) +sudo lcd4linux-theme apply SimpleBlue + +# Check what's currently active +lcd4linux-theme current +``` + +**If you're running from source**, point lcd4linux directly at the config file: ```bash ./lcd4linux -F -f themes//.conf diff --git a/themes/SimpleOrangeFall/dpf_simpleorangefall.conf b/themes/SimpleOrangeFall/dpf_simpleorangefall.conf index 3bb3ea0..f43dd4a 100644 --- a/themes/SimpleOrangeFall/dpf_simpleorangefall.conf +++ b/themes/SimpleOrangeFall/dpf_simpleorangefall.conf @@ -14,7 +14,7 @@ Display dpf { } # --------------------------------------------------------------- -# SimpleOarngeFall theme — 320x480 portrait +# SimpleOrangeFall theme — 320x480 portrait # 4 sections: CPU%, RAM%, GPU%, CPU Temp # # COORDINATE MAPPING for portrait mode (Orientation 1): @@ -33,7 +33,7 @@ Display dpf { # Background image (orange fall boxes on black) Widget Background { class 'Image' - file 'themes/SimpleOarngeFall/background.png' + file 'themes/SimpleOrangeFall/background.png' reload 0 update 0 visible 1 From be8e89501ddea5619766de5959773d5137af9bc9 Mon Sep 17 00:00:00 2001 From: Alejandro Mora Date: Sat, 11 Apr 2026 07:06:36 -0400 Subject: [PATCH 2/3] feat: add theme package for rpm/pkg --- README.md | 4 +- gh-pages/index.html | 9 ++-- lcd4linux-theme | 41 ++++++++++----- pkg/freebsd/+MANIFEST.themes | 18 +++++++ pkg/freebsd/+POST_INSTALL | 9 ++-- pkg/freebsd/+POST_INSTALL.themes | 5 ++ pkg/freebsd/build-pkg.sh | 85 +++++++++++++++++++++----------- pkg/freebsd/rc.d/lcd4linux | 7 ++- rpm/lcd4linux-ax206.spec | 20 ++++++++ 9 files changed, 148 insertions(+), 50 deletions(-) create mode 100644 pkg/freebsd/+MANIFEST.themes create mode 100644 pkg/freebsd/+POST_INSTALL.themes diff --git a/README.md b/README.md index add7d9d..b730c2f 100644 --- a/README.md +++ b/README.md @@ -85,9 +85,11 @@ sudo pkg install lcd4linux-ax206 **FreeBSD:** - `/usr/local/bin/lcd4linux` — the binary +- `/usr/local/bin/lcd4linux-theme` — theme management CLI - `/usr/local/etc/lcd4linux/lcd4linux.conf` — default configuration - `/usr/local/etc/lcd4linux/examples/` — additional example configs -- `/usr/local/share/lcd4linux/themes/` — pre-built themes +- `/usr/local/share/lcd4linux/themes/` — 39 pre-built themes +- `/usr/local/share/lcd4linux/fonts/` — bundled TrueType fonts - `/usr/local/etc/rc.d/lcd4linux` — rc.d service script ### Starting the service diff --git a/gh-pages/index.html b/gh-pages/index.html index 6b24125..468503f 100644 --- a/gh-pages/index.html +++ b/gh-pages/index.html @@ -93,21 +93,24 @@

lcd4linux-ax206

apt

Debian, Ubuntu, Mint
$ curl -fsSL https://amd989.github.io/lcd4linux-ax206/setup-apt.sh | sudo bash
-$ sudo apt install lcd4linux-ax206
+$ sudo apt install lcd4linux-ax206 +$ sudo apt install lcd4linux-ax206-themes # themes + lcd4linux-theme CLI (optional)

dnf / yum

RHEL, Rocky Linux, Fedora
$ curl -fsSL https://amd989.github.io/lcd4linux-ax206/setup-rpm.sh | sudo bash
-$ sudo dnf install lcd4linux-ax206
+$ sudo dnf install lcd4linux-ax206 +$ sudo dnf install lcd4linux-ax206-themes # themes + lcd4linux-theme CLI (optional)

pkg

FreeBSD, OPNSense, pfSense
$ curl -fsSL https://amd989.github.io/lcd4linux-ax206/setup-pkg.sh | sudo sh
-$ sudo pkg install lcd4linux-ax206
+$ sudo pkg install lcd4linux-ax206 +$ sudo pkg install lcd4linux-ax206-themes # themes + lcd4linux-theme CLI (optional)