2 unstable releases
0.2.0 | Nov 10, 2020 |
---|---|
0.1.0 | Nov 8, 2020 |
#3 in #osd
33KB
348 lines
xosd-rs
Rust bindings to the xosd library.
License
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
lib.rs
:
xosd-rs is a rust library with bindings to the xosd C/C++ library.
The API is very similar to the original. The main difference is that all
functions are implemented in Xosd
.
All functions return Result
since it builds on unsafe code.
Example
Taken from the xosd man page:
use xosd_rs::{Xosd, Command};
let mut osd = Xosd::new(1)?;
osd.set_font("fixed")?;
osd.set_color("LawnGreen")?;
osd.set_timeout(3)?;
osd.set_shadow_offset(1)?;
osd.display(0, Command::string("Example XOSD output")?)?;
osd.wait_until_no_display()?;
More examples can be found here.
Dependencies
~0.3–2.5MB
~51K SLoC