1![WhoAmI Logo](https://libcala.github.io/whoami/res/icon.svg) 2 3[![docs.rs](https://docs.rs/whoami/badge.svg)](https://docs.rs/whoami) 4[![tests](https://github.com/libcala/whoami/workflows/tests/badge.svg)](https://github.com/libcala/whoami/actions?query=workflow%3Atests) 5[![build status](https://api.travis-ci.com/libcala/whoami.svg?branch=master)](https://travis-ci.com/libcala/whoami) 6[![crates.io](https://img.shields.io/crates/v/whoami.svg)](https://crates.io/crates/whoami) 7 8[About](https://libcala.github.io/whoami) | 9[Source](https://github.com/libcala/whoami) | 10[Changelog](https://github.com/libcala/whoami/blob/master/CHANGELOG.md) 11 12# WhoAmI 13Retrieve the current user and environment. 14 15## Getting Started 16Using the whoami crate is super easy! All of the exported items are simple 17functions with no parameters that return either a `String` or enum. The 18following example shows how to use all of the functions: 19 20```rust 21fn main() { 22 println!( 23 "User→Name whoami::realname(): {}", 24 whoami::realname() 25 ); 26 println!( 27 "User→Username whoami::username(): {}", 28 whoami::username() 29 ); 30 println!( 31 "Host→Name whoami::devicename(): {}", 32 whoami::devicename() 33 ); 34 println!( 35 "Host→Hostname whoami::hostname(): {}", 36 whoami::hostname() 37 ); 38 println!( 39 "Platform whoami::platform(): {}", 40 whoami::platform() 41 ); 42 println!( 43 "OS Distro whoami::distro(): {}", 44 whoami::distro() 45 ); 46 println!( 47 "Desktop Env. whoami::desktop_env(): {}", 48 whoami::desktop_env() 49 ); 50} 51``` 52 53## Features 54* Get the user's full name 55* Get the user's username 56* Get the computer's hostname 57* Get the computer's fancy name 58* Get the computer's desktop environment 59* Get the computer's OS name and version 60* Get the computer's platform name 61* Works on Linux, Windows, Mac OS, and Web Assembly 62 63## Binary 64[whome](https://crates.io/crates/whome): replacement of the `whoami` command that depends on this crate. 65 66## TODO 67* Support iOS / Android / Nintendo Switch (and other consoles) / other OS's. 68 69# Contributing 70Contributors are always welcome! Whether it is a bug report, bug fix, feature 71request, feature implementation or whatever. Don't be shy about getting 72involved. I always make time to fix bugs, so usually a patched version of the 73library will be out soon after a report. Features take me longer, though. I'll 74also always listen to any design critiques you have. If you have any questions 75you can email me at jeronlau@plopgrizzly.com. Otherwise, here's a link to the 76[issues on GitHub](https://github.com/libcala/whoami/issues). 77 78And, as always, make sure to always follow the 79[code of conduct](https://github.com/libcala/whoami/blob/master/CODEOFCONDUCT.md). 80Happy coding! 81 82# License 83This repository is licensed under either of the following: 84 85- MIT License (MIT) - See accompanying file 86 [LICENSE_MIT.txt](https://github.com/libcala/whoami/blob/master/LICENSE_MIT.txt) 87 or copy at https://opensource.org/licenses/MIT 88- Boost Software License (BSL-1.0) - See accompanying file 89 [LICENSE_BSL.txt](https://github.com/libcala/whoami/blob/master/LICENSE_BSL.txt) 90 or copy at https://www.boost.org/LICENSE_1_0.txt 91 92at your option. 93 94## Contribution Licensing 95Unless you explicitly state otherwise, any contribution intentionally submitted 96for inclusion in the work by you shall be dual licensed as above without any 97additional terms or conditions. 98