diff options
| author | Christoph <code@c.onl> | 2025-11-10 20:48:28 +0100 |
|---|---|---|
| committer | Christoph <code@c.onl> | 2025-11-10 21:05:15 +0100 |
| commit | 396eaa2bda6ac4f2f7dad7cfa52f5343f8342192 (patch) | |
| tree | 60e666378df9d917a47f699a984c8ec015c1997e | |
| parent | 60d40612870edd98bf8a713b286ba502f3e95fe1 (diff) | |
| download | dots-396eaa2bda6ac4f2f7dad7cfa52f5343f8342192.tar.gz | |
polybar: Only show partitions in OpenBSD if less than 50% free
/home is always visible.
| -rwxr-xr-x | polybar/OpenBSD-storage.sh | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/polybar/OpenBSD-storage.sh b/polybar/OpenBSD-storage.sh index 6acd8b4..5266e6f 100755 --- a/polybar/OpenBSD-storage.sh +++ b/polybar/OpenBSD-storage.sh @@ -8,7 +8,12 @@ while true; do while IFS= read -r LINE; do PART="$(awk '{print $1}' <<< $LINE)" PERC="$(awk '{print $5}' <<< $LINE)" - print_line ${PART: -1} $PERC + if [[ "${PART: -1}" != "d" && \ + "${PERC:: -1}" -le 50 ]]; then + continue + fi + MNT="$(awk '{print $6}' <<< $LINE)" + print_line "${MNT}" "${PERC}" done <<< "$(df | grep '/dev/' | sort)" echo sleep 5 |