Skip to content

Conversation

@Emantor
Copy link

@Emantor Emantor commented May 19, 2025

This is useful for compositors such as niri, which can match on the layer shell namespace to put the background either behind the overview or set it as the normal desktop backdrop.

This is useful for compositors such as niri, which can match on the
layer shell namespace to put the background either behind the overview
or set it as the normal desktop backdrop.
@Emantor Emantor force-pushed the topic/explicit-namespace branch from fec6d4a to d9fb789 Compare May 19, 2025 11:22
@emersion
Copy link
Member

Hm, this isn't supposed to be configurable…

@YaLTeR
Copy link

YaLTeR commented May 19, 2025

FWIW niri is using namespace because there isn't really anything else to match on for layer surfaces.

The protocol says:

Clients can specify a namespace that defines the purpose of the layer surface.

From my reading, it makes sense for this to be settable in this way: you have one swaybg with the purpose of being a workspace background, and another for the purpose of being a backdrop background.

There's also existing precedent: fuzzel added an argument for setting the namespace: https://codeberg.org/dnkl/fuzzel/commit/5255c0a3439b161a6fd24b1fc57cf4d848fdd3a0 Here the idea is that fuzzel can be used as a password picker, then niri can match it by a custom namespace and block it out from screencast. But fuzzel as an application launcher is fine to show.

@emersion
Copy link
Member

swaybg is always supposed to be a wallpaper program. It's never supposed to be anything else.

@YaLTeR
Copy link

YaLTeR commented May 19, 2025

Here's a visual example of niri's overview:

image

This has two wallpapers: one inside the workspaces, and one behind everything. They are both wallpapers. The goal is being able to use swaybg for both, but for that niri needs to differentiate them somehow, and namespace seems to be a fitting property.

@emersion
Copy link
Member

Sorry, but I don't believe namespace is a fitting property. Namespace is intended to be fixed per app, not to be user-configurable.

You're looking for a way to tag surfaces with a custom user-provided string. Namespace is not that.

@Emantor
Copy link
Author

Emantor commented May 23, 2025

But namespace is an application defined string. The protocol states "Clients can specify a namespace that defines the purpose of the layer surface." and for niri a purpose i.e. "wallpaper-overview" makes sense to define the wallpaper for the overview.

Forking swaybg, renaming it into niri-overview-bg and than adding overview-wallpaper namespace there sounds like the wrong route to me when swaybg can support this via a user configurable option.

I can understand why you think that namespace is a misuse from the original intention, since I guess that the original intention was to provide a somewhat generic namespace identifier for applications (i.e. "wallpaper", "panel", "notifications", …) and a string was chosen to not have to operate with the constrains of a fixed enum which requires protocol revisions to update. But I don't think niris usage of the identifier is wrong here and taking a cursory look at the namespace usage in sway its currently only used for logging output.

Do we extend the namespace notion? Have swaybg default to wallpaper but allow custom subspaces to be set by the user like wallpaper::overview or wallpaper::niri-overview? Or do you think we need a new property within the layer shell protocol?

natsukagami added a commit to natsukagami/nix-home that referenced this pull request May 25, 2025
Using a fork of swaybg for swaywm/swaybg#87.
Using a fork of niri-flake with some additional configurations merged.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants