You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am attempting to make a function that get the resolution and refresh rate of the monitor(only figured out resolution so far) and I can only compile it atm by running the function in its on project and building it with cargo rustc -- -lX11
My Code
use std::ptr;use x11::xlib::{XCloseDisplay,XOpenDisplay,XScreenCount,XScreenOfDisplay};pubfnresolution(){unsafe{// open a displaylet display = XOpenDisplay(ptr::null());// return the number of available screenslet count_screens = XScreenCount(display);println!("Number of screens: {}", count_screens);for i in0..count_screens {let screen = *XScreenOfDisplay(display, i);println!("\tScreen {}: {}x{}",i+1,screen.width,screen.height);}// close the displayXCloseDisplay(display);}}pubfnmain(){resolution();}
I am attempting to make a function that get the resolution and refresh rate of the monitor(only figured out resolution so far) and I can only compile it atm by running the function in its on project and building it with cargo rustc -- -lX11
My Code
This my Cargo.toml
Am I doing something wrong? Is there anyway I can run this from with a project with multiple file inside the src directory?
The text was updated successfully, but these errors were encountered: