Skip to content

waycrate/waysip

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

292 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

A native, blazing-fast ๐Ÿš€๐Ÿš€๐Ÿš€ area selection tool for wlroots based compositors such as sway and river.


Some usage examples:

NOTE: Run waysip --help for the full list of flags and options.

Interactive rectangular area (prints position and size using the default format):

waysip -d

Pick a single point:

waysip -p

Print information about the focused screen:

waysip -i

Select a display output:

waysip -o

Combined dimensions / output mode (single click selects an output; drag selects a region):

waysip -d -o

Restrict selection to predefined boxes (pipe one box per line: x,y WIDTHxHEIGHT):

printf '100,200 400x300\n' | waysip -r

Custom output format (see % placeholders in --help; default is %x,%y %wx%h\n):

waysip -d -f '%x %y %w %h\n'

Shell completions:

waysip --completions fish | source
waysip --completions zsh > ~/.zfunc/_waysip
waysip --completions bash > /etc/bash_completion.d/waysip
waysip --completions elvish >> ~/.config/elvish/rc.elv
waysip --completions pwsh >> $PROFILE
waysip --completions nushell | save -f ~/.config/nushell/completions/waysip.nu

Optional features

All features except benchmark are enabled in the default build. To reduce binary size or compile-time dependencies, features can be selectively disabled:

cargo build --no-default-features --features frame-limiter
cargo build --no-default-features --features logger
cargo build --no-default-features --features completions
cargo build --no-default-features --features frame-limit,logger,completions
Feature What it adds Extra dependency
frame-limit Workaround to fix frametime issue on low frequency CPUs None
logger --log-level flag, tracing output to stderr tracing-subscriber
completions --completions <SHELL>, generate shell completion scripts clap_complete (+ nushell)
benchmark Benchmarking options for development described here None

Installation

Compile time dependencies:

  • rustup (Rust toolchain)
  • pkg-config
  • wayland
  • cairo
  • pango

Compiling:

  • git clone https://github.com/waycrate/waysip && cd waysip
  • cargo build --release
  • sudo mv ./target/release/waysip /usr/local/bin

Using Nix flakes (nixOS / Nix)

This repository provides a Nix flake for building and running waysip.

Build

nix build github:waycrate/waysip

Run

nix run github:waycrate/waysip

Development benchmarking

To enable benchmarking options use one of those options depending on usecase described later:

cargo build --no-default-features --features "logger completions benchmark"
cargo build --no-default-features --features "logger completions frame-limit benchmark"

Regarding frame-limit feature. It is a workaround enabled by default meant to solve issue with unstable frametime on low freq CPUs or under heavy load.

Benchmark usage

--bench

Records each wl_callback.done timestamp from the compositor for the focused screen (duplicate timestamps are dropped, so it's roughly one entry per frame) and prints frame stats on stderr when the selection ends.

Reported metrics (written to stderr):

  • fps avg
  • frametime: min / avg / max
  • latencies - array of entries meant track where frametime issues happened

For drag modes the raw duration and the amount trimmed from each end are also printed. For non-drag options less frames-better.

To test frametime stability try lowering your cpu freq to 0.8 GHz and build without frame-limit feature before testing.

Support:

  1. https://matrix.to/#/#waycrate-tools:matrix.org
  2. https://discord.gg/KKZRDYrRYW

About

Wayland native area selector for compositors implementing zwlr_layer_shell.

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Contributors