I have a script that I run on RHEL (currently 8.4, but this has worked on many previous versions). It uses wmctrl -a
to activate specific windows. I just created a Fedora 36 VM on VirtualBox and there wmctrl -a
does nothing. Likewise wmctrl -l
lists nothing. I am using the default window manager which I believe is Gnome 41. Can anyone assist?
2 Answers
wmctrl
is a utility for X.org
/X11
, you are most likely running a Wayland session.
Unfortunately to the best of my knowledge Wayland doesn't have any alternatives.
Wayland developers are not concerned with anything approaching the usability of X.org.
-
2Bingo! Thanks. All I did was reconfigure not to use Wayland.– Tom LInkCommented Dec 30, 2021 at 22:39
-
-
As mentioned in another answer, wmctrl
doesn't fully work with Wayland. However, there is an alternative way to have hotkeys raise a window (or launch an app) since you're using GNOME:
'Run or raise' GNOME extension
As bonus, it has some additional functionality (that would be more work to accomplish with your own scripts and wmctrl), such as cycling through matching windows upon repeating the hotkey, and bringing the window to your active workspace (it's nice being able to pull the terminal around whenever I want rather than always having it on all workspaces).