4

In my shellrc I have a function to activate (focus / bring to the foreground) a window by its title, using the org.gnome.Shell Eval dbus interface. (The xdotool approach doesn’t work under Wayland.) This worked great until GNOME 41 restricted the ability to call Eval. Does anyone have an alternative solution, other than enabling the new “unsafe mode” (which reenables Eval, but is apparently, well, unsafe) or writing a dedicated extension?

2 Answers 2

4

Since I couldn’t find any existing way of doing this, I eventually wrote my own GNOME Shell extension, Activate Window By Title (source). It exposes a custom D-Bus interface that can be used instead of org.gnome.Shell.Eval, for example:

busctl --user call \
    org.gnome.Shell \
    /de/lucaswerkmeister/ActivateWindowByTitle \
    de.lucaswerkmeister.ActivateWindowByTitle \
    activateBySubstring \
    s 'Firefox'
3

I found

https://github.com/CZ-NIC/run-or-raise

https://extensions.gnome.org/extension/1336/run-or-raise/

and this works perfectly.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .