Simple disk usage feedback

import matplotlib.pyplot as plt from shutil import disk_usage in_gb = lambda byte_count: byte_count / (1024 ** 3) bytes_usage = disk_usage('/') usage_type_colors = ( ('used', 'grey'), ('free', 'green'), ('total', 'black') ) font_size = 12 fig, ax = plt.subplots(figsize=(3.5, 6.5)) ax.set_title('Disk usage', fontsize=font_size + 2) for i, usage_type in enumerate(usage_type_colors): ax.bar(i, in_gb(bytes_usage[(i + 1) % 3]), width=.9, color=usage_type[1]) ax.set_xticks(range(3)) ax.set_xticklabels(list(map(lambda x: x[0], usage_type_colors)), fontsize=font_size) ax.set_ylabel('gigabytes', fontsize=font_size) plt.tight_layout() plt.show() Disk usage feedback diagram

Note: This has been tested under Linux only.