• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

.github/H11-Jul-2021-9881

cargo-crates/H03-May-2022-1,362,2431,061,853

src/H03-May-2022-1,003801

.gitignoreH A D11-Jul-2021151 107

CHANGELOG.mdH A D11-Jul-20211.8 KiB4633

Cargo.lockH A D03-May-202221.6 KiB876780

Cargo.tomlH A D03-May-2022922 4538

LICENSEH A D11-Jul-20211 KiB2217

README.mdH A D11-Jul-20214.6 KiB11874

release.tomlH A D11-Jul-2021673 1110

README.md

1# wmfocus - Visually focus windows by label
2
3[![CI](https://github.com/svenstaro/wmfocus/workflows/CI/badge.svg)](https://github.com/svenstaro/wmfocus/actions)
4[![AUR](https://img.shields.io/aur/version/wmfocus.svg)](https://aur.archlinux.org/packages/wmfocus/)
5[![Crates.io](https://img.shields.io/crates/v/wmfocus.svg)](https://crates.io/crates/wmfocus)
6[![license](http://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/svenstaro/wmfocus/blob/master/LICENSE)
7[![Stars](https://img.shields.io/github/stars/svenstaro/wmfocus.svg)](https://github.com/svenstaro/wmfocus/stargazers)
8[![Lines of Code](https://tokei.rs/b1/github/svenstaro/wmfocus)](https://github.com/svenstaro/wmfocus)
9
10This tool that allows you to rapidly choose a specific window directly without having to use the mouse or directional keyboard navigation.
11
12![Screen cast](cast.apng)
13
14Thanks to cairo, it should work on all kinds of screens and automatically display at the correct size according to your DPI.
15
16
17## Installation
18
19<a href="https://repology.org/project/wmfocus/versions"><img align="right" src="https://repology.org/badge/vertical-allrepos/wmfocus.svg" alt="Packaging status"></a>
20
21**On Arch Linux**: [Get it from AUR](https://aur.archlinux.org/packages/wmfocus/)
22
23**With Cargo**: `cargo install --features i3 wmfocus`
24
25## Usage
26
27Draw labels on the upper-left corner of all windows:
28
29    wmfocus
30
31Completely fill out windows and draw the label in the middle (try it with transparency!):
32
33    wmfocus --fill
34
35Use a different font (as provided by fontconfig):
36
37    wmfocus -f "Droid Sans":100
38
39Change up the default colors:
40
41    wmfocus --textcolor red --textcoloralt "#eeeeee" --bgcolor "rgba(50, 50, 200, 0.5)"
42
43wmfocus will make use of a compositor to get real transparency.
44
45## Full help
46```
47wmfocus 1.2.0
48Sven-Hendrik Haase <svenstaro@gmail.com>
49
50
51USAGE:
52    wmfocus [FLAGS] [OPTIONS]
53
54FLAGS:
55        --fill         Completely fill out windows
56    -h, --help         Prints help information
57    -p, --printonly    Print the window id only but don't change focus
58    -V, --version      Prints version information
59
60OPTIONS:
61        --textcolor <text_color>           Text color (CSS notation) [default: #dddddd]
62        --textcoloralt <text_color_alt>    Text color alternate (CSS notation) [default: #666666]
63        --bgcolor <bg_color>               Background color (CSS notation) [default: rgba(30, 30, 30, 0.9)]
64        --halign <horizontal_align>        Horizontal alignment of the box inside the window [default: left]  [possible
65                                           values: left, center, right]
66        --valign <vertical_align>          Vertical alignment of the box inside the window [default: top]  [possible
67                                           values: top, center, bottom]
68    -e, --exit-keys <exit-keys>...         List of keys to exit application, sequence separator is space, key separator
69                                           is '+', eg Control_L+g Shift_L+f
70    -f, --font <font>                      Use a specific TrueType font with this format: family:size [default: Mono:72]
71    -c, --chars <hint_chars>               Define a set of possbile values to use as hint characters [default:
72                                           sadfjklewcmpgh]
73    -m, --margin <margin>                  Add an additional margin around the text box (value is a factor of the box
74                                           size) [default: 0.2]
75    -o, --offset <offset>                  Offset box from edge of window (x,y) [default: 0,0]
76```
77
78## Troubleshooting
79
80If there's some funky stuff, you can try to track it down by running `wmfocus` with `RUST_LOG=trace`:
81
82    RUST_LOG=trace wmfocus
83
84This will print quite some useful debugging info.
85
86
87## Compiling
88
89You need to have recent versions of `rust`, `cargo`, `xcb-util-keysyms`, `libxkbcommon-x11` and `cairo` installed.
90
91Then, just clone it like usual and `cargo run` to get output:
92
93    git clone https://github.com/svenstaro/wmfocus.git
94    cd wmfocus
95    cargo run --features i3
96
97
98## Window manager support
99
100While this tool is window manager-independent, an implementation for your favorite window manager might not yet be available. Current support:
101
102- i3
103- sway (partial, accepting PRs)
104
105If you want to implement support for more window managers, have a look at the [i3 implementation](https://github.com/svenstaro/wmfocus/blob/master/src/wm_i3.rs).
106
107This tool is heavily inspired by [i3-easyfocus](https://github.com/cornerman/i3-easyfocus).
108
109
110## Releasing
111
112This is mostly a note for me on how to release this thing:
113
114- `cargo release --dry-run`
115- `cargo release`
116- Release will automatically be deployed by Github Actions.
117- Update Arch package.
118