Gdbus wayland: get size and position of a window

205 Views Asked by At

I cannot find any examples on how to use gdbus to get the position and rect size of a window.

I am able to get the window's pid using code from other stackoverflow questions, but there is no way to get that window's current position relative to the screen.

This is bash code I found that can let me get the active window's pid, but I also need its rect

#https://github.com/hseliger/window-calls-extended
if [ ! -d window-calls-extended ]; then
    git clone https://github.com/hseliger/window-calls-extended.git
fi
pushd window-calls-extended
mkdir -p ~/.local/share/gnome-shell/extensions/[email protected]/
cp extension.js metadata.json ~/.local/share/gnome-shell/extensions/[email protected]/
popd


#https://github.com/essembeh/gnome-extensions-cli
pip3 install --upgrade gnome-extensions-cli
~/.local/bin/gext install [email protected]

#gdbus call --session --dest org.gnome.Shell --object-path /org/gnome/Shell/Extensions/WindowsExt --method org.gnome.Shell.Extensions.WindowsExt.List
#gdbus call --session --dest org.gnome.Shell --object-path /org/gnome/Shell/Extensions/WindowsExt --method org.gnome.Shell.Extensions.WindowsExt.FocusTitle
#gdbus call --session --dest org.gnome.Shell --object-path /org/gnome/Shell/Extensions/WindowsExt --method org.gnome.Shell.Extensions.WindowsExt.FocusPID
0

There are 0 best solutions below