static double diskSpacePercentage_oshi() { ret diskSpacePercentage_oshi(userDir()); // default to home partition } static double diskSpacePercentage_oshi(File f) { OSFileStore fs = oshi_findFileStore(f); if (fs == null) { // default to non-oshi long total = f.getTotalSpace(); long usable = f.getUsableSpace(); ret doubleRatio(total-usable, total); } long total = fs.getTotalSpace(); long usable = fs.getUsableSpace(); long total2 = fs.getTotalInodes(); long usable2 = fs.getFreeInodes(); ret max(doubleRatio(total-usable, total), total2 <= 0 ? 0 : doubleRatio(total2-usable2, total2))*100; }