Function pin_window

Source
pub fn pin_window(which: WindowArgument) -> Command
Examples found in repository?
examples/simple_recipe_sync.rs (line 16)
4fn main() {
5    let conn = HyprlandConnection::current().unwrap();
6
7    // make the current window 400x400, place it in the top right corner and pin it
8    let commands = [
9        set_floating(WindowArgument::ActiveWindow),
10        resize_active_window(ResizeArgument::Exact(
11            NumPercent::Number(400),
12            NumPercent::Number(400),
13        )),
14        move_window_in_direction(DirectionArgument::Up, true),
15        move_window_in_direction(DirectionArgument::Right, true),
16        pin_window(WindowArgument::ActiveWindow),
17    ];
18
19    match conn.send_recipe_sync(&commands) {
20        Ok(()) => println!("successful"),
21        Err(errors) => println!("{:?}", errors),
22    }
23}
More examples
Hide additional examples
examples/simple_recipe.rs (line 17)
5async fn main() {
6    let conn = HyprlandConnection::current().unwrap();
7
8    // make the current window 400x400, place it in the top right corner and pin it
9    let commands = [
10        set_floating(WindowArgument::ActiveWindow),
11        resize_active_window(ResizeArgument::Exact(
12            NumPercent::Number(400),
13            NumPercent::Number(400),
14        )),
15        move_window_in_direction(DirectionArgument::Up, true),
16        move_window_in_direction(DirectionArgument::Right, true),
17        pin_window(WindowArgument::ActiveWindow),
18    ];
19
20    match conn.send_recipe(&commands).await {
21        Ok(()) => println!("successful"),
22        Err(errors) => println!("{:?}", errors),
23    }
24}