Wmctrl: Difference between revisions

From wikinotes
No edit summary
 
 
(One intermediate revision by the same user not shown)
Line 4: Line 4:
<blockquote>
<blockquote>
<source lang="bash">
<source lang="bash">
wmctrl -l           # list all window-ids
# list all window-ids by desktop-id
wmctrl -l    # ${window_id} ${desktop_id} ${hostname} ${window_title}
wmctrl -l -G  # ${window_id} ${desktop_id} ${x_offset} ${y_offset} ${width} ${height} ${hostname} ${window_title}
 
# list desktops
wmctrl -d    # ${desktop_id} ${star_current_desktop} DG: ${width}x${height} VP: ${viewport_y},${viewport_y} WA: ${pos_x}x${pos_y} ${width}x${height}
 
wmctrl -a 'STRING'  # focus window whose name contains 'STRING'
wmctrl -a 'STRING'  # focus window whose name contains 'STRING'
</source>
</source>
</blockquote><!-- Usage -->
</blockquote><!-- Usage -->

Latest revision as of 14:29, 18 July 2021

A tool to control linux UI from the terminal.

Usage

# list all window-ids by desktop-id
wmctrl -l     # ${window_id} ${desktop_id} ${hostname} ${window_title}
wmctrl -l -G  # ${window_id} ${desktop_id} ${x_offset} ${y_offset} ${width} ${height} ${hostname} ${window_title}

# list desktops
wmctrl -d     # ${desktop_id} ${star_current_desktop} DG: ${width}x${height} VP: ${viewport_y},${viewport_y} WA: ${pos_x}x${pos_y} ${width}x${height}

wmctrl -a 'STRING'  # focus window whose name contains 'STRING'