Wmctrl Wrapper
A wrapper for the command line tool wmctrl written in Rust
Dependencies
wmctrl needs to be installed:
# Ubuntu
sudo apt install wmctrl
# Arch Linux
sudo pacman -S wmctrl
# Fedora
dnf install -y wmctrl
# You get the idea
Usage
Add wmctrl
to your dependencies in your Cargo.toml
:
[]
= "0.1.7"
If you want the latest build use the 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.unwrap;
println!;
Resize and move a window to the specified coordinates:
let mut windows = get_windows;
let win = &mut windows;
// 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 windows = get_windows;
let win = &windows;
// Make the window fullscreen
win.change_state;