index : gmss.git

ascending towards madness

use screenshots::Screen;

pub struct Display;

impl Display {
    /// A wrapper around `screenshots::Screen::all()` to get displays in order from left to right
    pub fn get_displays() -> Vec<Screen> {
        let mut screens = Screen::all().unwrap_or_else(|err| {
            eprintln!("there was an error retrieving screens: {:?}", err);
            vec![]
        });

        screens.sort_by(|first, second| first.display_info.x.cmp(&second.display_info.x));
        screens
    }
}