Is there a way to restrict a widget to a single virtual desktop?

I use two virtual desktops. On the main one, I have a news-ticker widget that ideally I’d like to hide when I switch to the second desktop.

Searching around, it seems that there was a way to do this in Plasma 4&5, but none of the solutions for those versions seems to be valid for Plasma 6.

Is there a way to restrict a widget to a single desktop in Plasma 6? Or alternatively to hide/unhide it (perhaps using qdbus) which I could invoke in a script?

Hi @beermad,

I use a Window rule for this.

I had thought of that idea, but when I clicked on the widget to select its characteristics the picker just selected the desktop.

How did you select the specific widget?

Make sure there’s nothing over the widget, that’s what I do. And keep it out from under potential windows.

Also make sure that there is no setting enabled for the widget visibility to change on hover or timeout or something like that.

Anything more I haven’t encountered yet, so

:man_shrugging:

Strange… Even pulling it to a completely blank area, the properties grabber still thinks it’s just Plasmashell itself (even tried creating a different widget in case it was something odd about the news ticker)

Looks like my search continues. Thanks for your input, anyway @Mirdarthos

1 Like

You could always try creating the rule manually in ~/.config/kwinrulesrc. However, with that I am unable to help you.

Perhaps this offers something:

https://www.reddit.com/r/kde/comments/1m69ua2/how_to_apply_kwin_rules_from_the_command_line/

https://unix.stackexchange.com/a/573910

Edit:

From:

https://www.reddit.com/r/kde/comments/1c447nc/anything_like_xprop_in_wayland_to_get_window/

…enter the following in terminal:

qdbus6 org.kde.KWin /KWin queryWindowInfo

Your mouse cursor will turn into a crosshair, click on desired window, the attribute you’re interested is named resourceClass it will hold your window class name.

Thanks for the suggestion. Unfortunately, even with the qdbus command my widget still shows up as Plasmashell.

I suspect I’m going to have to try another approach; possibly using activities.

[Edit]: yep, seems activities is the way to go here. I wondered if I’d ever find a use for that facility…

2 Likes

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.