screenlocker
Screenlocker is a command line program (and reusable library) to request your desktop session to be locked using the current platform's native API.
Installation
Use Rust's cargo tool to install screenlocker.
$ cargo install screenlocker
$ screenlocker # if $PATH contains `~/.cargo/bin`
Please contact me or create a new issue if you would like to have downloadable installers for your platform rather than use cargo.
Usage
Command line
Screenlocker is invoked on the command line with no parameters, and will immediately lock your desktop session or print an error if it cannot.
For additional information on using the command line tool invoke the tool like
this: screenlocker --help.
Library
Screenlocker is also available as a reusable Rust library. The latest API documentation is available from a link on screenlockers's crates.io page.
Generally all you need is the lock_screen function, as seen here in this
example:
use lock_screen;
lock_screen;
Building
Make sure you install Rust on your computer before building.
$ git clone git@github.com:smacdo/screenlocker.git
$ cd screenlocker
$ cargo test
$ cargo run
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.