Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 30 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,17 +72,24 @@ 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/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
Expand Down Expand Up @@ -230,10 +237,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.
Expand Down
8 changes: 8 additions & 0 deletions debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -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.
3 changes: 3 additions & 0 deletions debian/lcd4linux-ax206-themes.install
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
lcd4linux-theme usr/bin
themes usr/share/lcd4linux
fonts usr/share/lcd4linux
1 change: 1 addition & 0 deletions debian/lcd4linux-ax206.dirs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
usr/share/lcd4linux
3 changes: 2 additions & 1 deletion debian/lcd4linux-ax206.service
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -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
9 changes: 6 additions & 3 deletions gh-pages/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -93,21 +93,24 @@ <h1>lcd4linux-ax206</h1>
<h2>apt</h2>
<div class="distros">Debian, Ubuntu, Mint</div>
<pre><code><span class="prompt">$ </span><span class="cmd">curl -fsSL https://amd989.github.io/lcd4linux-ax206/setup-apt.sh | sudo bash</span>
<span class="prompt">$ </span><span class="cmd">sudo apt install lcd4linux-ax206</span></code></pre>
<span class="prompt">$ </span><span class="cmd">sudo apt install lcd4linux-ax206</span>
<span class="prompt">$ </span><span class="cmd">sudo apt install lcd4linux-ax206-themes</span> <span class="prompt"># themes + lcd4linux-theme CLI (optional)</span></code></pre>
</div>

<div class="card">
<h2>dnf / yum</h2>
<div class="distros">RHEL, Rocky Linux, Fedora</div>
<pre><code><span class="prompt">$ </span><span class="cmd">curl -fsSL https://amd989.github.io/lcd4linux-ax206/setup-rpm.sh | sudo bash</span>
<span class="prompt">$ </span><span class="cmd">sudo dnf install lcd4linux-ax206</span></code></pre>
<span class="prompt">$ </span><span class="cmd">sudo dnf install lcd4linux-ax206</span>
<span class="prompt">$ </span><span class="cmd">sudo dnf install lcd4linux-ax206-themes</span> <span class="prompt"># themes + lcd4linux-theme CLI (optional)</span></code></pre>
</div>

<div class="card">
<h2>pkg</h2>
<div class="distros">FreeBSD, OPNSense, pfSense</div>
<pre><code><span class="prompt">$ </span><span class="cmd">curl -fsSL https://amd989.github.io/lcd4linux-ax206/setup-pkg.sh | sudo sh</span>
<span class="prompt">$ </span><span class="cmd">sudo pkg install lcd4linux-ax206</span></code></pre>
<span class="prompt">$ </span><span class="cmd">sudo pkg install lcd4linux-ax206</span>
<span class="prompt">$ </span><span class="cmd">sudo pkg install lcd4linux-ax206-themes</span> <span class="prompt"># themes + lcd4linux-theme CLI (optional)</span></code></pre>
</div>

<footer>
Expand Down
193 changes: 193 additions & 0 deletions lcd4linux-theme
Original file line number Diff line number Diff line change
@@ -0,0 +1,193 @@
#!/bin/sh
# lcd4linux-theme — theme manager for lcd4linux-ax206
set -e

VERSION="1.0.0"

# OS-specific configuration
if [ "$(uname)" = "FreeBSD" ]; then
DATA_DIR=/usr/local/share/lcd4linux
CONFIG_DIR=/usr/local/etc/lcd4linux
SERVICE_NAME=lcd4linux
restart_service() {
if service "$SERVICE_NAME" status >/dev/null 2>&1; then
service "$SERVICE_NAME" restart
echo "Service restarted."
else
echo "Start the service with: sudo service $SERVICE_NAME start"
fi
}
else
DATA_DIR=/usr/share/lcd4linux
CONFIG_DIR=/etc/lcd4linux
SERVICE_NAME=lcd4linux-ax206
restart_service() {
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
}
fi

THEMES_DIR="$DATA_DIR/themes"
CONFIG_FILE="$CONFIG_DIR/lcd4linux.conf"
MARKER_FILE="$CONFIG_DIR/.current-theme"

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 <name>' 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 <name>" >&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
}

usage() {
cat <<EOF
lcd4linux-theme $VERSION — theme manager for lcd4linux-ax206

Usage:
lcd4linux-theme list List available themes
lcd4linux-theme apply <name> 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
18 changes: 18 additions & 0 deletions pkg/freebsd/+MANIFEST.themes
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: lcd4linux-ax206-themes
version: "${VERSION}"
origin: sysutils/lcd4linux-ax206-themes
comment: Themes and fonts for lcd4linux-ax206
maintainer: amd989@users.noreply.github.com
www: https://github.com/amd989/lcd4linux-ax206
prefix: /usr/local
desc: <<EOD
Collection of 39 pre-built themes with background images and TrueType fonts
for AX206 USB LCD displays. Includes the lcd4linux-theme CLI for easy
theme switching.
EOD
categories: [sysutils]
licenselogic: single
licenses: [GPLv3]
deps: {
lcd4linux-ax206: { origin: sysutils/lcd4linux-ax206, version: "${VERSION}" }
}
9 changes: 5 additions & 4 deletions pkg/freebsd/+POST_INSTALL
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ echo "Enabling lcd4linux service..."
sysrc lcd4linux_enable=YES 2>/dev/null || true
echo ""
echo "=== lcd4linux-ax206 installed ==="
echo " Config: /usr/local/etc/lcd4linux/lcd4linux.conf"
echo " Themes: /usr/local/share/lcd4linux/themes/"
echo " Start: service lcd4linux start"
echo " Status: service lcd4linux status"
echo " Config: /usr/local/etc/lcd4linux/lcd4linux.conf"
echo " Start: service lcd4linux start"
echo " Status: service lcd4linux status"
echo ""
echo "Install themes: pkg install lcd4linux-ax206-themes"
5 changes: 5 additions & 0 deletions pkg/freebsd/+POST_INSTALL.themes
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh
echo "=== lcd4linux-ax206-themes installed ==="
echo " List themes: lcd4linux-theme list"
echo " Apply a theme: lcd4linux-theme apply SimpleBlue"
echo " Current theme: lcd4linux-theme current"
Loading
Loading