#screen #linux #macos

resolution

Retrieves current screen resolution

1 unstable release

0.1.1 May 21, 2023
0.1.0 May 21, 2023

#27 in #screen

31 downloads per month
Used in kodumaro-nonogram

BSD-3-Clause

5KB
54 lines

Resolution

Crate to retrieve screen resolution/dimensions on Linux and macOS.

Rational

I have rewrite this same code so many times that it justifies existing.

Install

cargo add resolution

Interface

  • resolution::current_resolution() -> Result<(i32, i32), resolution::ResolutionError>

It receives no parameter and returns current screen’s (width, height).

License

Dependencies

~0.3–1MB
~24K SLoC