diff options
| author | Henry J. Webster <hwebs@hwebs.info> | 2026-07-30 17:21:43 -0500 |
|---|---|---|
| committer | Henry J. Webster <hwebs@hwebs.info> | 2026-07-30 17:21:43 -0500 |
| commit | 574f1bcedd2a8eef0cfdf059c3038291bbf6e4e4 (patch) | |
| tree | 7af41ab37b00a8e13a400cc4eb623af6cb77c259 /yambar | |
| parent | 5e5e38f7b473f6c3fc2e8102ceea5090be2cad4d (diff) | |
yambar: add RAM and disk-space indicators
RAM via the built-in mem module (percent_used, reddened over 85%).
Disk free space has no native module, so add disk.sh emitting df output
as script-module tags (disk_avail human string + disk_used range).
Separators added between the new elements.
Assisted-by: Claude:claude-opus-4-8
Diffstat (limited to 'yambar')
| -rw-r--r-- | yambar/.config/yambar/config.yml | 20 | ||||
| -rwxr-xr-x | yambar/.config/yambar/disk.sh | 12 |
2 files changed, 32 insertions, 0 deletions
diff --git a/yambar/.config/yambar/config.yml b/yambar/.config/yambar/config.yml index 20de729..8ee2ad8 100644 --- a/yambar/.config/yambar/config.yml +++ b/yambar/.config/yambar/config.yml @@ -25,6 +25,26 @@ bar: default: {string: {text: "offline"}} conditions: carrier: {string: {text: "\uf1eb {ssid}"}} + - label: + content: {string: {text: "|"}} + - mem: + poll-interval: 5000 + content: + map: + default: {string: {text: "\uf538 {percent_used}%"}} + conditions: + percent_used > 85: {string: {text: "\uf538 {percent_used}%", foreground: ff5555ff}} + - label: + content: {string: {text: "|"}} + - script: + path: ~/.config/yambar/disk.sh + content: + map: + default: {string: {text: "\uf0a0 {disk_avail}"}} + conditions: + disk_used > 85: {string: {text: "\uf0a0 {disk_avail}", foreground: ff5555ff}} + - label: + content: {string: {text: "|"}} - battery: name: BAT0 poll-interval: 30000 diff --git a/yambar/.config/yambar/disk.sh b/yambar/.config/yambar/disk.sh new file mode 100755 index 0000000..4a91899 --- /dev/null +++ b/yambar/.config/yambar/disk.sh @@ -0,0 +1,12 @@ +#!/bin/sh +# Emits root filesystem usage as yambar tags (continuous mode). +# disk_avail: human-readable free space (e.g. "42G") +# disk_used: percent used, as a range for conditional styling +while true; do + avail=$(df -h --output=avail / | tail -n1 | tr -d ' ') + pct=$(df --output=pcent / | tail -n1 | tr -dc '0-9') + echo "disk_avail|string|$avail" + echo "disk_used|range:0-100|$pct" + echo "" + sleep 30 +done |
