1
0
mirror of https://github.com/eoli3n/dotfiles synced 2024-11-22 23:12:32 +01:00

merci nheir ;)

This commit is contained in:
eoli3n 2021-05-27 11:10:17 +02:00
parent ee9bbf6a02
commit c0fce92e04

@ -1,9 +1,5 @@
#!/usr/bin/env bash
# Functions
escape() { while read l; do printf '%s\\n' "$l"; done }
# Vars
warning=85
critical=95
target="$1"
@ -19,7 +15,7 @@ elif [[ "$fstype" == zfs ]]
then
zfsroot=$(findmnt -nT "$target" -o SOURCE | sed 's:/.*::')
pcent=$(zpool list -o cap -H "$zfsroot" | tr -d '%')
tooltip=$(escape <<< "$(zfs list -o name,used,compressratio,logicalused,avail)")
tooltip="$(zfs list -o name,used,compressratio,logicalused,avail | awk '{printf "%s\\n", $0}')"
else
pcent=$(df "$target" --output="pcent" 2>/dev/null | sed 1d | tr -d ' ' | tr -d '%')
tooltip="$pcent"