As I already answered to you when you asked the same on the gnome-shell-extensions mailing list: All those shortcuts are handled by internal mutter functions, not via D-Bus or CLI commands.
Thank you very much for directing me to this forum.
So, how can i solve the problem mentioned in
neither xdotool nor wmctrl is working when the window is tiled or snapped. You can test the first command on the github issue. You can also check with the scripts provided with the issue.
Mutter is the library that gnome-shell uses to implement the X (and wayland) window manager.
Xdotool and wmctrl are generally poor options if you need full control over the window manager, the best way to get full control over it (in GNOME) is to write a shell extension.
You will have to read a tutorial like the extension guide to get a general idea of how to write extensions. In the extension you can call global.get_window_actors() to get a list of windows. Then you can do something like this to move and resize the windows:
const current = global.get_window_actors().find(win => win.has_focus());
for (const win of global.get_window_actors()) {
if (win.meta_window.wm_class === current?.meta_window.wm_class) {
if (win.meta_window.get_maximized() !== 0)
win.meta_window.unmaximize(Meta.MaximizeFlags.BOTH);
const x = 0, y = 0, w = 100, h = 100; // TODO - calculate the right size
win.meta_window.move_resize_frame(true, x, y, w, h);
}
}
So, if I make an extension that will have these functions, i will be able to call these functions from a bash script using busctl, dbus-send or gdbus etc.
Is that it or is there any better solution (without using dbus). The point is I want to call functions defined in gnome extension from a shell script.
IMO it would be better to avoid shell scripts, and just write the necessary functionality in the extension as javascript. It is possible to do like that extension and expose anything from the shell as dbus functionality, but this a pretty roundabout way to do it. And also, it is not secure as anything with access to the session bus could abuse that to mess with the window manager.