9 stable releases

1.1.5 Oct 26, 2020
1.1.4 Aug 7, 2020
1.1.3 Jul 2, 2019
1.1.2 Jan 8, 2019
1.0.2 Sep 27, 2018

#110 in Command line utilities

31 downloads per month

MIT license

689 lines

wmfocus - Visually focus windows by label

CI AUR Crates.io license Stars Lines of Code

This tool that allows you to rapidly choose a specific window directly without having to use the mouse or directional keyboard navigation.

Screen cast

Thanks to cairo, it should work on all kinds of screens and automatically display at the correct size according to your DPI.


Packaging status

On Arch Linux: Get it from AUR

With Cargo: cargo install --features i3 wmfocus


Draw labels on the upper-left corner of all windows:


Completely fill out windows and draw the label in the middle (try it with transparency!):

wmfocus --fill

Use a different font (as provided by fontconfig):

wmfocus -f "Droid Sans":100

Change up the default colors:

wmfocus --textcolor red --textcoloralt "#eeeeee" --bgcolor "rgba(50, 50, 200, 0.5)"

wmfocus will make use of a compositor to get real transparency.

Full help

wmfocus 1.1.5
Sven-Hendrik Haase <svenstaro@gmail.com>

    wmfocus [FLAGS] [OPTIONS]

        --fill         Completely fill out windows
    -h, --help         Prints help information
    -p, --printonly    Print the window id only but don't change focus
    -V, --version      Prints version information

        --textcolor <text_color>           Text color (CSS notation) [default: #dddddd]
        --textcoloralt <text_color_alt>    Text color alternate (CSS notation) [default: #666666]
        --bgcolor <bg_color>               Background color (CSS notation) [default: rgba(30, 30, 30, 0.9)]
        --halign <horizontal_align>        Horizontal alignment of the box inside the window [default: left]  [possible
                                           values: left, center, right]
        --valign <vertical_align>          Vertical alignment of the box inside the window [default: top]  [possible
                                           values: top, center, bottom]
    -f, --font <font>                      Use a specific TrueType font with this format: family:size [default: Mono:72]
    -c, --chars <hint_chars>               Define a set of possbile values to use as hint characters [default:
    -m, --margin <margin>                  Add an additional margin around the text box (value is a factor of the box
                                           size) [default: 0.2]
    -o, --offset <offset>                  Offset box from edge of window (x,y) [default: 0,0]


If there's some funky stuff, you can try to track it down by running wmfocus with RUST_LOG=trace:

RUST_LOG=trace wmfocus

This will print quite some useful debugging info.


You need to have recent versions of rust, cargo, xcb-util-keysyms, libxkbcommon-x11 and cairo installed.

Then, just clone it like usual and cargo run to get output:

git clone https://github.com/svenstaro/wmfocus.git
cd wmfocus
cargo run --features i3

Window manager support

While this tool is window manager-independent, an implementation for your favorite window manager might not yet be available. Current support:

  • i3
  • sway (partial, accepting PRs)

If you want to implement support for more window managers, have a look at the i3 implementation.

This tool is heavily inspired by i3-easyfocus.


This is mostly a note for me on how to release this thing:

  • cargo release --dry-run
  • cargo release
  • Release will automatically be deployed by Github Actions.
  • Update AUR package.


~156K SLoC