Wmctrl Wrapper
A wrapper for the command line tool wmctrl written in Rust
Usage
Add wmctrl
to your dependencies in your Cargo.toml
:
[]
= "0.1.3"
If you want the latest build use this GitHub repository as your uplink:
[]
= { = "https://github.com/Treborium/rust-wmctrl" }
Examples
Please refer to the documentation for detailed information.
If you want to copy & paste the examples below you need to use the following import statement:
use ;
Find a window based on the title:
let windows = get_windows;
let firefox = find_window_by_title?;
println!;
Resize and move a window to the specified coordinates:
let win = get_windows.get?;
// This will move the window to the top left corner and resize it to 960x540
win.transform;
Close the window gracefully:
// We need to move the window out of the vector so there is no reference left
let win: Window = get_windows.remove;
win.close;
Make the window fullscreen:
let win = get_windows.get?;
// Make the window fullscreen
win.change_state;