diff --git a/.config/i3blocks/disk b/.config/i3blocks/disk index 41d1d66..0208759 100755 --- a/.config/i3blocks/disk +++ b/.config/i3blocks/disk @@ -5,19 +5,20 @@ import sys CRIT = 90.0 MOUNT_BLACKLIST = ['/dev', '/efi', '/proc', '/run', '/sys', '/tmp'] +FS_BLACKLIST = ['//', 'cgroup', 'tmpfs'] def main(): output = subprocess.check_output([ - 'sh', '-c', 'df -a -B 1 | awk \'{ printf "%s\\t%d\\t%d\\n", $6, $2, $4 }\'' + 'sh', '-c', 'df -a -B 1 | awk \'{ printf "%s\\t%d\\t%d\\t%s\\n", $6, $2, $4, $1 }\'' ]).decode('utf-8') fs = {} for line in output.split('\n'): if len(line) == 0 or line[0] != '/': continue - (mountpoint, total, available) = line.split('\t') - fs[mountpoint] = (total, available) + (mountpoint, total, available, filesystem) = line.split('\t') + fs[mountpoint] = (total, available, filesystem) color = '#50fa7b' @@ -28,6 +29,10 @@ def main(): if mount.startswith(b): skip = True + for b in FS_BLACKLIST: + if data[2].startswith(b): + skip = True + if skip: continue