Score:1

Having trouble moving windows between screens via the terminal

US flag

I'm running 22.04.2 LTS. I'm trying to write a script that will organize open windows. Unfortunately, wmctrl -l returns an incomplete list.

PS /home/edward/Documents/rclone> wmctrl -l
0x0260003d 1 Lenovo-11e Having trouble moving windows between screens via the terminal. - Ask Ubuntu — Mozilla Firefox

I have more windows open than that. xdotools runs into the same limitation. I've read that this is a problem with Wayland as the window manager. Regardless, is there another utility I might try that can move windows around in the Gnome UI?

Score:1
cn flag

You hit the nail. This happens indeed because you run Wayland. The only windows that are listed by wmctrl -l are those that run on Xorg through Xwayland.

Wayland has caused fragmentation. Methods to manipulate windows now depend on the wayland compositor, so differ between Gnome Shell, KDE desktop and Sway window manager, for example.

dbus calls in Gnome Shell to manipulate windows have now been made private to Gnome Shell only. However, Gnome Shell extensions can expose dbus functionality so it can be accessed through a script.

Such an extension is Window Calls by domandoman. It allows to list windows and manipulate them (resizing, moving, mazimizing, minimizing, activating, closing). Another extension, Window Calls Extended by hseliger expands on this extension by allowing to obtain information on the currently focused window.

This is in my opinion not the ideal world: we depend on extensions. A Gnome Shell extension may become unmaintained and break in future versions of Gnome Shell.

So it will be a matter of starting again from scratch: the old ways do not work on Wayland. Alternatively, you still can decide not to use Wayland and switch to an Xorg session. This is still fully supported.

Ed C. avatar
md
I have considered switching away from Wayland. I'll have to do some reading about the differences. Thank you for your help. I am about to give Window Calls a go.
vanadium avatar
cn flag
If this answer resolved your question, then please show your appreciation by "accepting" it: click the checkmark next to the question.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.