Customizable statusline, df (#1168)

* opts statusline, df

* renamed infostat -> ruler; removed os_lin, os_bsd

* removed vscode

---------

Co-authored-by: rr <rr@arveex.eu>
This commit is contained in:
rrveexandrr authored and GitHub committed 2023-04-09 14:50:34 +03:00
1 parent 821b2fcd51
commit eb84772032
8 files changed
+79 -1

No files matched your search

+11
View File
@@ -230,3 +230,14 @@ func exportFiles(f string, fs []string, pwd string) {
os.Setenv("fx", envFiles)
}
}
func diskFree(wd string) string {
var stat unix.Statfs_t
if err := unix.Statfs(wd, &stat); err != nil {
log.Printf("diskfree: %s", err)
return ""
}
// Available blocks * size per block = available space in bytes
return " df: " + humanize(int64(uint64(stat.Bavail)*uint64(stat.Bsize)))
}