Skip to content
budRich edited this page Jul 13, 2023 · 9 revisions

NAME

i3get - prints info about a specific window to stdout

SYNOPSIS

i3get [OPTIONS]

OPTIONS

-c, --class        CLASS         | target windows with CLASS  
-n, --conid        CON_ID        | target windows with CON_ID  
-h, --help                       | print help and exit  
-d, --id           WIN_ID        | target windows with WIN_ID  
-i, --instance     INSTANCE      | target windows with INSTANCE
--json             TREE          | Use TREE instead of the output of `i3-msg -t get_tree`
-m, --mark         MARK          | MARK | target containers with MARK  
-r, --print        OUTPUT        | what to print. defaults to 'n'  
--print-format     FORMAT_STRING | %v is value, %k is name. default: '%vn'  
--role             ROLE          | match ROLE against window_role  
-y, --synk                       | block script till window exist.
--timeout          SECONDS       | seconds for --synk to timeout (defaults to 60)  
-t, --title        TITLE         | target windows with TITLE  
-o, --titleformat  TITLE_FORMAT  | match TITLE_FORMAT against title_format  
--type             TYPE          | match TYPE against window_type  
--verbose                        | print messages to stderr  
-v, --version                    | print version info and exit  
--winid            WIN_ID        | target windows with WIN_ID  

-r, --print OUTPUT

OUTPUT can be one or more of the following characters:

character print return
t title string
c class string
i instance string
d Window ID INT
n Con_Id (default) INT
m mark JSON list
w workspace number INT
W workspace name STRING
a is active true or false
f floating state string
o title format string
e fullscreen 1 or 0
s sticky true or false
u urgent true or false
y window_type string
r window_role string

Each character in OUTPUT will be tested and the return value will be printed on a new line. If no value is found, --i3get could not find: CHARACTER will get printed.

In the example below, the target window did not have a mark:

$ i3get -r tfcmw
/dev/pts/9
user_off
URxvt
--i3get could not find: m
1

USAGE

Search for CRITERIA in the output of i3-msg -t get_tree, return desired information. If no arguments are passed, con_id of active window is returned. If there is more then one criterion, all of them must be true to get results.

EXAMPLES

search for window with instance name sublime_text. Request workspace, title and floating state.

$ i3get --instance sublime_text --print wtf 
1
~/src/bash/i3ass/i3get (i3ass) - Sublime Text
user_off

CONTACT

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

COPYRIGHT

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

Clone this wiki locally