Skip to content

i3viswiz

budRich edited this page Jul 13, 2023 · 9 revisions

NAME

i3viswiz - professional window focus for i3wm

SYNOPSIS

i3viswiz     [--gap|-g GAPSIZE] DIRECTION 
i3viswiz     --title|-t TITLE       [--gap|-g GAPSIZE] [DIRECTION|TARGET] [--focus|-f] 
i3viswiz     --instance|-i INSTANCE   [--gap|-g GAPSIZE] [DIRECTION|TARGET] [--focus|-f]
i3viswiz     --class|-c CLASS      [--gap|-g GAPSIZE] [DIRECTION|TARGET] [--focus|-f]
i3viswiz     --titleformat|-o FORMAT [--gap|-g GAPSIZE] [DIRECTION|TARGET] [--focus|-f]
i3viswiz     --winid|-d  WINID     [--gap|-g GAPSIZE] [DIRECTION|TARGET] [--focus|-f]
i3viswiz     --parent|-p  CONTAINER   [--gap|-g GAPSIZE] [DIRECTION|TARGET] [--focus|-f]
i3viswiz     --role|-r ROLE       [--gap|-g GAPSIZE] [DIRECTION|TARGET] [--focus|-f]
i3viswiz     --type|-y TYPE       [--gap|-g GAPSIZE] [DIRECTION|TARGET] [--focus|-f]
i3viswiz     --scratchpad
i3viswiz     [--json JSON] [--debug VARLIST] [--debug-format FORMAT] [--verbose]
i3viswiz     --help|-h
i3viswiz     --version|-v

OPTIONS

-c, --class        CLASS     | find window by **class**
--debug            VARLIST   | detailed output   
--debug-format     FORMAT    | how to format debug output  
-f, --focus                  | focus target **visible** window  
-g, --gap          GAPSIZE   | distance in pixels from the current window where new focus will be searched.  
-h, --help                   | print help and exit  
-i, --instance     INSTANCE  | find window by **instance**
--json             JSON      | use JSON instead of `i3-msg -t get_tree`  
-p, --parent       CONTAINER | window is visible in the i3fyra CONTAINER 
-r, --role         ROLE      | find window by **window_role**
--scratchpad                 | this will treat the scratchpad as the active workspace.
-t, --title        TITLE     | find window by **class**  
-o, --titleformat  FORMAT    | find window by **title_format**  
-y, --type         TYPE      | find window by **window_type**
--verbose                    | louder output   
-v, --version                | print version info and exit  
-d, --winid        WINID     | window is visible with WINID  

--debug VARLIST

VARLIST is used to determine what to output. By default the value of VARLIST is: LIST . Available units are:

wall         | none|(up|left|down|right-)(workspace|area)
trgcon       | container id of the window to be focused
trgpar       | name of i3fyra container target container is located in
gap          | internal gap value used
sw           | active workspace width
sh           | active workspace height
sx           | active workspace x position
sy           | active workspace y position
aw           | active window width
ah           | active window height
ax           | active window x position
ay           | active window y position
trgx         | target windows x position
trgy         | target windows y position
grouplayout  | active windows parent container layout (tabbed|splitv|splith|stacked)
groupid      | active windows parent container ID
grouppos     | active windows position relative to its sibling containers
groupsize    | number of child containers in active windows parent container
firstingroup | container ID of the first child in active windows parent container
lastingroup  | container ID of the last child in active windows parent container
LIST         | prints a table with all visible windows
ALL          | all the above combined

Multiple units can be used if comma separated.

NB
For this option to be usefule LIST must be the search criterion.

Example:

$ i3viswiz --instance LIST up --debug gap,wall,grouppos
gap=5 wall=up-area grouppos=1 

--debug-format FORMAT

The default value of FORMAT is "%k=%v ". %k is translated to the key/unit name, and %v to the value.

Example:

$ i3viswiz --instance LIST u --debug gap,wall,grouppos --debug-format "%v\n"
5
up-area
1 

-f, --focus

if this is not set, the CON_ID of target window will get printed to STDOUT.

-p, --parent CONTAINER

CONTAINER is one of the i3fyra containers: A|B|C|D

--scratchpad

This is useful if you have a f.i. a tabbed container on the scratchpad, and you want to get the id of the window that have focus in that container.

USAGE

i3viswiz either prints a list of the currently visible tiled windows to stdout or shifts the focus depending on the arguments.

If a DIRECTION (left|right|up|down) is passed, i3wizvis will shift the focus to the window closest in the given DIRECTION, or warp focus if there are no windows in the given direction.

examples

replace the normal i3 focus keybindings with viswiz like this:

Normal binding:
bindsym Mod4+Shift+Left   focus left

Wizzy binding:
bindsym Mod4+Left   exec --no-startup-id i3viswiz left

example output:

$ i3viswiz --instance LIST

* 94475856575600 ws: 1 x: 0     y: 0     w: 1558  h: 410   | termsmall
- 94475856763248 ws: 1 x: 1558  y: 0     w: 362   h: 272   | gl
- 94475856286352 ws: 1 x: 0     y: 410   w: 1558  h: 643   | sublime_main
- 94475856449344 ws: 1 x: 1558  y: 272   w: 362   h: 781   | thunar-lna

If --class , --instance, --title, --titleformat, --winid or --parent is used together with the argument LIST. i3viswiz will print this output, with the type in the last column of the table (class in the example above).

If the argument is not LIST the container ID of a visible window matching the criteria will be printed.

Assuming the same scenario as the example above, the following command:
$ i3viswiz --instance termsmall
will output the container_id (94475856575600).
If no window is matching output will be blank.

Multiple criteria is allowed:
$ i3viswiz --instance termsmall --class URxvt

focus wrapping

if the setting "focus_wrapping" is set to "workspace" in the i3config. i3viswiz will wrap the focus only inside the currenttly focused workspace instead of the whole work area (other monitors).

The setting has to be present in the active config before the first i3viswiz invokation.

To force this behavior otherwise, issue the following command:
i3var set focus_wrap workspace

Or to disable it:
i3var set focus_wrap normal

CONTACT

Send bugs and feature requests to:
https://github.com/budlabs/i3ass/issues

COPYRIGHT

Copyright (c) 2018-2023, budRich of budlabs
SPDX-License-Identifier: MIT

Clone this wiki locally