sway-easyfocus

A tool to help efficiently focus windows in Sway inspired by i3-easyfocus.

https://github.com/edzdez/sway-easyfocus/assets/31393290/b71b1875-6c8b-4891-803c-763b040a55ff

Config File

The config file is found at $XDG_CONFIG_HOME/sway-easyfocus/config.yaml If a key is not found in the config file nor provided as a cli option, then it uses a default value.

An example config is with the default options is shown below:

```yaml windowbackgroundcolor: 1d1f21 windowbackgroundopacity: 0.2

labelbackgroundcolor: 1d1f21 labelbackgroundopacity: 1.0 labeltextcolor: c5c8c6

fontfamily: monospace fontweight: bold

labelpaddingx: 4 labelpaddingy: 0 labelmarginx: 4 labelmarginy: 2 ```

Usage

``` A tool to help efficiently focus windows in Sway inspired by i3-easyfocus.

Usage: sway-easyfocus [OPTIONS]

Options: --window-background-color set the window background color --window-background-opacity set the window background opacity <0-1.0> --label-background-color set the label background color --label-background-opacity set the label background opacity <0-1.0> --label-text-color set the label text color --font-family

  --font-weight <FONT_WEIGHT>

  --label-padding-x <LABEL_PADDING_X>

  --label-padding-y <LABEL_PADDING_Y>

  --label-margin-x <LABEL_MARGIN_X>

  --label-margin-y <LABEL_MARGIN_Y>

-h, --help Print help -V, --version Print version ```

Build

This program is written in Rust. The Rust compiler can be installed by following the instructions on the official download page.

You also need to have gtk and gtk-layer-shell installed.

```shell

Clone this repo

$ git clone https://github.com/edzdez/sway-easyfocus.git

Build with cargo

$ cargo build --release $ ./target/release/sway-easyfocus

Alternatively, build and run in one step

$ cargo run --release ```