ATNewHope / swaymsg-treefetch

A bash script to get coordinates and size of window matching provided app_id using swaymsg.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Swaymsg-treefetch: Simple bash scripts to fetch wanted info using swaymsg

Requirements

  • Window Manager: sway
  • Dependencies: swaymsg, jshon
  • Execution permission. To acquire this, use following
sudo chmod +x <path to script>

Swaymsg-rectfetcher

Fetch rect info of window with app_id.

This bash script could get the rect (i.e. absolute coordinates and size) info of the window with specified app_id (the first argument) in SwayWM.

If multiple window matches, the focused window will be selected. If no one is focused, the first one will be selected.

Remove every '#' before "$pecho" in the script file to get verbose output.

Usage

 $ ./swaymsg-rectfetcher.sh <app_id>

Output format

 <x> <y>

Swaymsg-rectfetcher

Fetch the app_id of focused window.

Remove every '#' before "$pecho" in the script file to get verbose output.

Usage

 $ ./swaymsg-focusfetcher.sh

Output format

 <app_id>

Examples

$ ./swaymsg-rectfetcher.sh emacs
1080 1546
$ ./swaymsg-focusfetcher.sh
emacs

LICENSE

MIT license

About

A bash script to get coordinates and size of window matching provided app_id using swaymsg.

License:MIT License


Languages

Language:Shell 100.0%