You are not logged in.

#1 2023-04-19 14:38:46

zw963
Member
Registered: 2018-06-18
Posts: 209

The GNOME way to set/unset active window always on top from CLI.

At first, not all application can use right click menu to set current window always on top, if use wmctrl, it probably ignore some wayland windows.

So, i expect a robust way to always make current active window always on top.

I assume i can use windows-call gnome extension to find the active window out, like this:

window_list=`gdbus call --session --dest org.gnome.Shell --object-path /org/gnome/Shell/Extensions/Windows --method org.gnome.Shell.Extensions.Windows.List`
wid=`echo "${window_list:2:-3}" | jq -c '.[] | select (.focus == true) | .id '`

Then, i get the windows id.

 ╰─ $ echo $wid 
2653443754

then, how to use a command line to set this wid window always on top?

Or, is there a more easy way to set current active window always on top directly? it should work on GNOME + Wayland too.

Thanks

Last edited by zw963 (2023-04-20 17:14:27)

Offline

#2 2023-04-19 15:19:31

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,330
Website

Re: The GNOME way to set/unset active window always on top from CLI.

There is no "wayland way" to set a window to always be on top - neither for an end user or for an application developer.  For the application developer there are non-standard protocols used by some compositors that allow this type of behavior (e.g., the layer-shell protocol for a wide range of compositors ... but not gnome as gnome devs really don't want to play well with others; they wrote their own gnome/mutter-specific protocol for similar behavior).

For end users there is no "wayland way" to do this, but there might be a "gnome way" to do it if gnome provides such an option.  So thats where you need to focus your search - and changing your title to reference gnome (rather than "wayland") may draw the attention of those would might be able to provide gnome-specific information.

zw963 wrote:

At first, not all application can use right click menu to set current window always on top

Does this mean that some applications can be set to always on top through a menu?  Can you give some examples of programs whose windows can and can't be set this way?  It may be that the distinction is between those that are integral parts of the gnome desktop (written specifically to use gnome-only protocols) and those that are general wayland/xdg-shell clients (and thus don't use the gnome-only protocols).

Last edited by Trilby (2023-04-19 15:41:07)


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#3 2023-04-20 05:48:41

jl2
Member
From: 47° 18' N 8° 34' E
Registered: 2022-06-01
Posts: 464
Website

Re: The GNOME way to set/unset active window always on top from CLI.

KDE settings has the Option, in case you use it.
It isn't the only one.

Last edited by jl2 (2023-04-20 05:49:09)


Why I run Arch? To "BTW I run Arch" the guy one grade younger.
And to let my siblings and cousins laugh at Arsch Linux...

Offline

#4 2023-04-20 06:57:04

icar
Member
From: Catalunya
Registered: 2020-07-31
Posts: 507

Re: The GNOME way to set/unset active window always on top from CLI.

If it's a PiP window, try https://extensions.gnome.org/extension/4691/pip-on-top/

If you are OK setting them manually, ctrl+space brings the compositor menu, and iirc there was another combination with a mouse click that I can't remember now.

Offline

#5 2023-04-20 17:12:17

zw963
Member
Registered: 2018-06-18
Posts: 209

Re: The GNOME way to set/unset active window always on top from CLI.

If you are OK setting them manually, ctrl+space brings the compositor menu, and iirc there was another combination with a mouse click that I can't remember now.

Not all windows support the mouse click menu, e.g. Firefox(wayland mode) seem like no way to make that menu appear.

But, it's seem like the "activate window menu" keybinding should working. (i disable it before because it conflict with Chinese input method), i still prefer a quick way to set/unset current active window always on top, i don't understand how to use that PiP extension.

Trilby wrote:

Does this mean that some applications can be set to always on top through a menu?  Can you give some examples of programs whose windows can and can't be set this way?  It may be that the distinction is between those that are integral parts of the gnome desktop (written specifically to use gnome-only protocols) and those that are general wayland/xdg-shell clients (and thus don't use the gnome-only protocols).

e.g. The `telegram-desktop`, the right click on the title bar, i can see the right click menu, "Always on top" available there, but firefox(wayland mode), no way activate activate window menu from mouse only.

In fact, what i want is really the GNOME way to make all window "Always on top", i will change my title.

thanks

Last edited by zw963 (2023-04-20 17:49:14)

Offline

#6 2024-10-26 06:08:58

FeRDNYC
Member
Registered: 2015-07-19
Posts: 2

Re: The GNOME way to set/unset active window always on top from CLI.

An older post, I know, but...

zw963 wrote:

Not all windows support the mouse click menu, e.g. Firefox(wayland mode) seem like no way to make that menu appear.

If you're running GNOME Shell, you should be able to reach the window-management context menu on any application, even one that overrides the normal titlebar context-menu binding (or doesn't have a titlebar), by holding down the Super key and right-clicking anywhere on the application window. That's built into Mutter, AFAIK, so I don't think it's even possible for an application to disable that binding. (Just like Super+drag can move any window, even if it resists normal dragging.)

Offline

Board footer

Powered by FluxBB