pub struct XHandle { /* private fields */ }
Implementations§
source§impl XHandle
impl XHandle
sourcepub fn open() -> Result<Self, XrandrError>
pub fn open() -> Result<Self, XrandrError>
sourcepub fn all_outputs(&mut self) -> Result<Vec<Output>, XrandrError>
pub fn all_outputs(&mut self) -> Result<Vec<Output>, XrandrError>
sourcepub fn set_primary(&mut self, o: &Output)
pub fn set_primary(&mut self, o: &Output)
sourcepub fn set_mode(
&mut self,
output: &Output,
mode: &Mode
) -> Result<(), XrandrError>
pub fn set_mode( &mut self, output: &Output, mode: &Mode ) -> Result<(), XrandrError>
Sets the mode of a given output, relative to another
Arguments
output
- The output to change mode formode
- The mode to change to
Errors
XrandrError::_
- various calls to the xrandr backend may fail
Examples
let dp_1 = xhandle.all_outputs()?[0];
let mode = dp_1.preferred_modes[0];
xhandle.set_mode(dp_1, mode)?;
sourcepub fn set_position(
&mut self,
output: &Output,
relation: &Relation,
relative_output: &Output
) -> Result<(), XrandrError>
pub fn set_position( &mut self, output: &Output, relation: &Relation, relative_output: &Output ) -> Result<(), XrandrError>
Sets the position of a given output, relative to another
Arguments
output
- The output to repositionrelation
- The relationoutput
will have torel_output
rel_output
- The output to position relative to
Errors
XrandrError::_
- various calls to the xrandr backend may fail
Examples
let dp_1 = outputs[0];
let hdmi_1 = outputs[3];
xhandle.set_position(dp_1, Relation::LeftOf, hdmi_1)?;
sourcepub fn set_rotation(
&mut self,
output: &Output,
rotation: &Rotation
) -> Result<(), XrandrError>
pub fn set_rotation( &mut self, output: &Output, rotation: &Rotation ) -> Result<(), XrandrError>
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for XHandle
impl !Send for XHandle
impl !Sync for XHandle
impl Unpin for XHandle
impl UnwindSafe for XHandle
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more