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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ The 3.5" AX206 USB displays are cheap and widely available, but most of the soft

This fork aims to fix that by providing ready-to-use themes ported from the [Turing Smart Screen](https://github.com/mathoudebine/turing-smart-screen-python) theme ecosystem and adapted to work with LCD4Linux's config system. In the process, new widgets were added: **Gauge** (circular arc rings) and **Sparkline** (line graph history); to support the variety of visual styles these themes use. The goal is to make it as easy as possible to plug in a display and have a polished system monitor running in minutes.

The best source for general LCD4Linux information is [The unofficial LCD4Linux Wiki](https://wiki.lcd4linux.tk/doku.php/start).
For more information visit the [LCD4Linux-ax206 Wiki](https://github.com/amd989/lcd4linux-ax206/wiki).

![Example](lcd4linux_example.png)

Expand Down
5 changes: 0 additions & 5 deletions TODO

This file was deleted.

75 changes: 58 additions & 17 deletions themes/NAS/dpf_4baynas.conf
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ Widget Storage_Status {
class 'Truetype'
expression '• Healthy'
font 'fonts/jetbrains-mono/JetBrainsMono-Regular.ttf'
fcolor '00aaff'
fcolor '296ca3'
size 9
align 'R'
width 100
Expand All @@ -190,7 +190,7 @@ Widget RAID_Label {
class 'Truetype'
expression 'SNAPRAID'
font 'fonts/jetbrains-mono/JetBrainsMono-Bold.ttf'
fcolor '00aaff'
fcolor '215683'
size 9
align 'L'
width 120
Expand Down Expand Up @@ -219,7 +219,7 @@ Widget Main_Storage_Bar {
length 280
width 5
direction 'E'
color '00aaff'
color '296ca3'
background '333333'
min 0
max 100
Expand All @@ -246,7 +246,7 @@ Widget Bay1_Temp {
class 'Truetype'
expression precision(exec('cat /sys/block/' . bay1_blk . '/device/hwmon/hwmon*/temp1_input 2>/dev/null || echo 32000', 5000) / 1000, 0) . '°C'
font 'fonts/jetbrains-mono/JetBrainsMono-Bold.ttf'
fcolor '00aaff'
fcolor '296ca3'
size 11
align 'C'
width 50
Expand Down Expand Up @@ -288,7 +288,7 @@ Widget Bay2_Temp {
class 'Truetype'
expression precision(exec('cat /sys/block/' . bay2_blk . '/device/hwmon/hwmon*/temp1_input 2>/dev/null || echo 35000', 5000) / 1000, 0) . '°C'
font 'fonts/jetbrains-mono/JetBrainsMono-Bold.ttf'
fcolor '00aaff'
fcolor '296ca3'
size 11
align 'C'
width 50
Expand Down Expand Up @@ -330,7 +330,7 @@ Widget Bay3_Temp {
class 'Truetype'
expression precision(exec('cat /sys/block/' . bay3_blk . '/device/hwmon/hwmon*/temp1_input 2>/dev/null || echo 38000', 5000) / 1000, 0) . '°C'
font 'fonts/jetbrains-mono/JetBrainsMono-Bold.ttf'
fcolor '00aaff'
fcolor '296ca3'
size 11
align 'C'
width 50
Expand Down Expand Up @@ -372,7 +372,7 @@ Widget Bay4_Temp {
class 'Truetype'
expression precision(exec('cat /sys/block/' . bay4_blk . '/device/hwmon/hwmon*/temp1_input 2>/dev/null || echo 40000', 5000) / 1000, 0) . '°C'
font 'fonts/jetbrains-mono/JetBrainsMono-Bold.ttf'
fcolor '00aaff'
fcolor '296ca3'
size 11
align 'C'
width 50
Expand Down Expand Up @@ -453,14 +453,39 @@ Widget IO_Unit {
}


Widget IO_Sparkline {
# Reads (field 3) — Layout layer 1; fillunder = gradient under curve (see Layer 0/1)
Widget IO_Sparkline_Read {
class 'Sparkline'
expression exec('f=/tmp/lcd_io_' . io_disk . '; set -- $(cat /sys/block/' . io_disk . '/stat); c=$(($3+$7)); if [ -f $f ] && [ $(($(date +%s)-$(stat -c %Y $f))) -lt 15 ]; then p=$(cat $f); else p=$c; fi; echo $c > $f; echo $((c-p))', 5000)
expression exec('f=/tmp/lcd_io_' . io_disk . '_r; set -- $(cat /sys/block/' . io_disk . '/stat); c=$3; if [ -f $f ] && [ $(($(date +%s)-$(stat -c %Y $f))) -lt 15 ]; then p=$(cat $f); else p=$c; fi; echo $c > $f; echo $((c-p))', 5000)
width 80
length 139
samples 60
color '296ca3'
background '000000ff'
thickness 2
smooth 1
smoothsteps 72
valueblur 5
fillunder 1
fillalpha 56
stroke 'solid'
update tack
}

# Writes (field 7) — Layout layer 0 (above reads); lighter tint so dashes read against the read line
Widget IO_Sparkline_Write {
class 'Sparkline'
expression exec('f=/tmp/lcd_io_' . io_disk . '_w; set -- $(cat /sys/block/' . io_disk . '/stat); c=$7; if [ -f $f ] && [ $(($(date +%s)-$(stat -c %Y $f))) -lt 15 ]; then p=$(cat $f); else p=$c; fi; echo $c > $f; echo $((c-p))', 5000)
width 80
length 139
samples 60
color '00aaff'
background '000000ff'
thickness 2
smooth 1
smoothsteps 72
valueblur 5
stroke 'dashed'
update tack
}

Expand Down Expand Up @@ -498,7 +523,7 @@ Widget CPU_Val {
class 'Truetype'
expression precision(proc_stat::cpu('busy', 500), 0).'%'
font 'fonts/jetbrains-mono/JetBrainsMono-Bold.ttf'
fcolor '00aaff'
fcolor '296ca3'
size 8
align 'R'
width 35
Expand All @@ -514,7 +539,7 @@ Widget CPU_Bar {
length 125
width 4
direction 'E'
color '00aaff'
color '296ca3'
background '333333'
min 0
max 100
Expand All @@ -539,7 +564,7 @@ Widget MEM_Val {
class 'Truetype'
expression precision((meminfo('MemTotal') - meminfo('MemAvailable')) / meminfo('MemTotal') * 100, 0).'%'
font 'fonts/jetbrains-mono/JetBrainsMono-Bold.ttf'
fcolor '00aaff'
fcolor '296ca3'
size 8
align 'R'
width 35
Expand All @@ -555,7 +580,7 @@ Widget MEM_Bar {
length 125
width 4
direction 'E'
color '00aaff'
color '296ca3'
background '333333'
min 0
max 100
Expand All @@ -580,7 +605,7 @@ Widget TEMP_Val {
class 'Truetype'
expression precision(exec('cat /sys/class/thermal/thermal_zone0/temp 2>/dev/null || cat /sys/class/thermal/thermal_zone1/temp 2>/dev/null || echo 45000', 10000) / 1000, 0).'°C'
font 'fonts/jetbrains-mono/JetBrainsMono-Bold.ttf'
fcolor '00aaff'
fcolor '296ca3'
size 8
align 'R'
width 35
Expand All @@ -596,7 +621,7 @@ Widget TEMP_Bar {
length 125
width 4
direction 'E'
color '00aaff'
color '296ca3'
background '333333'
max 100
update 5000
Expand All @@ -607,6 +632,10 @@ Widget TEMP_Bar {
# Layout
# ---------------------------------------------------------------
Layout layout_4baynas {
# Layer 0 is composited above Layer 1 (see drv_generic_graphic_blend): sparkline write on top of read
Layer 0 {
X388.Y14 'IO_Sparkline_Write'
}
Layer 1 {
X5.Y104 'Time'
X10.Y215 'TimeAmPm'
Expand Down Expand Up @@ -636,7 +665,7 @@ Layout layout_4baynas {
X365.Y30 'IO_Read_Val'
X365.Y77 'IO_Write_Val'
X365.Y120 'IO_Unit'
X388.Y14 'IO_Sparkline'
X388.Y14 'IO_Sparkline_Read'
X343.Y189 'System_Title'
X369.Y178 'CPU_Label'
X369.Y258 'CPU_Val'
Expand All @@ -656,5 +685,17 @@ Layout layout_4baynas {

Display 'dpf'

Layout 'layout_4baynas'

Mirror 'VNC'

Layout 'layout_4baynas'
Display VNC {
Driver 'VNC'
Font '6x8'
Port '5900'
Xres '320'
Yres '480'
Bpp '4'
Maxclients '2'
Osd_showtime '2000'
}
43 changes: 36 additions & 7 deletions themes/OPNSense/dpf_opnsense.conf
Original file line number Diff line number Diff line change
Expand Up @@ -160,14 +160,40 @@ Widget Net_Unit {
}


Widget Net_Sparkline {
# Download (Rx) — Layer 1; solid + fill under curve
Widget Net_Sparkline_Down {
class 'Sparkline'
expression netdev(net_if, 'Rx_bytes', 500) + netdev(net_if, 'Tx_bytes', 500)
expression netdev(net_if, 'Rx_bytes', 500)
width 60
length 290
samples 60
color 'f97316'
background '000000ff'
thickness 2
smooth 1
smoothsteps 48
valueblur 3
fillunder 1
fillalpha 56
stroke solid
update tack
}

# Upload (Tx) — Layer 0 (above download); dashed
Widget Net_Sparkline_Up {
class 'Sparkline'
expression netdev(net_if, 'Tx_bytes', 500)
width 60
length 290
samples 60
color 'f97316'
background '000000ff'
thickness 2
smooth 1
smoothsteps 48
valueblur 3
fillunder 0
stroke dashed
update tack
}

Expand Down Expand Up @@ -488,10 +514,10 @@ Widget CONN_Label {
Widget CONN_Val {
class 'Truetype'
# Active TCP connections
# Linux: ss -t state established (iproute2, not available on FreeBSD)
# FreeBSD / OPNsense (pfctl): exec('pfctl -si 2>/dev/null | grep "current entries" | grep -oE "[0-9]+" | head -1', 5000)
# FreeBSD / OPNsense (netstat): exec('netstat -an 2>/dev/null | grep ESTABLISHED | wc -l', 5000)
expression exec('netstat -an 2>/dev/null | grep ESTABLISHED | wc -l', 5000)
# Linux: ss -t state established
expression exec('ss -t state established 2>/dev/null | tail -n +2 | wc -l', 5000)
font 'fonts/source-sans-3/SourceSans3-Bold.ttf'
fcolor 'f97316'
size 10
Expand Down Expand Up @@ -519,9 +545,9 @@ Widget BLOCK_Label {
Widget BLOCK_Val {
class 'Truetype'
# Firewall block rules hit count (or tracked state count on Linux)
# Linux: cat /proc/sys/net/netfilter/nf_conntrack_count (conntrack, not available on FreeBSD)
# FreeBSD / OPNsense: exec('pfctl -vsr 2>/dev/null | grep -c "^block"', 10000)
expression exec('pfctl -vsr 2>/dev/null | grep -c "^block"', 10000)
# Linux: cat /proc/sys/net/netfilter/nf_conntrack_count
expression exec('cat /proc/sys/net/netfilter/nf_conntrack_count 2>/dev/null || echo 0', 10000)
font 'fonts/source-sans-3/SourceSans3-Bold.ttf'
fcolor 'f59e0b'
size 10
Expand Down Expand Up @@ -549,6 +575,9 @@ Widget FW_Sparkline {
# Layout
# ---------------------------------------------------------------
Layout layout_opnsense {
Layer 0 {
X132.Y16 'Net_Sparkline_Up'
}
Layer 1 {
X5.Y110 'Time'
X30.Y210 'TimeAmPm'
Expand All @@ -558,7 +587,7 @@ Layout layout_opnsense {
X112.Y15 'Net_Down_Val'
X112.Y75 'Net_Up_Val'
X112.Y128 'Net_Unit'
X132.Y16 'Net_Sparkline'
X132.Y16 'Net_Sparkline_Down'
X214.Y37 'Devices_Title'
X214.Y125 'Devices_Count'
X277.Y27 'LAN_Count'
Expand Down
Loading
Loading