macOS/Windows version of treefetch
( Help wanted )
treefetch in its current state only supports Linux. Use Rust conditional compilation in the fields.rs file to write separate code for each OS; Windows and macOS. You may also modify the main.rs a bit if needed.
The fetch information you need to implement for either Windows or macOS are:
- username / hostname
- OS name
- kernel (if applicable)
- Shell name
- Uptime
- Memory usage
You can make a PR implementing only Windows or only macOS support for now if you want.
I suggest doing something like this:
#[cfg(target_os = "linux")]
pub fn get_memory() -> Result<String, String> {
...
}
#[cfg(target_os = "macos")]
pub fn get_memory() -> Result<String, String> {
...
}
#[cfg(target_os = "windows")]
pub fn get_memory() -> Result<String, String> {
...
}
Hi, I'm the author of systemstat, would you accept a PR that uses systemstat for uptime and memory and adds more things systemstat supports (such as battery percentage and disk usage)?
Hi, I'm the author of systemstat, would you accept a PR that uses systemstat for uptime and memory and adds more things systemstat supports (such as battery percentage and disk usage)?
@unrelentingtech Sure! I'd love to see how you would implement this in treefetch.