Use Plasma panels with other Wayland compositors?

Duncan 1i5t5.duncan at cox.net
Thu Jan 4 07:52:35 GMT 2024


HiPhish posted on Sun, 17 Dec 2023 09:52:20 +0000 as excerpted:

> I would like to use Plasma panels and widgets with some other compositor
> like Hyprland, and I want to know if this is possible, either right now
> or at least at some point in the future.

This is possible, yes, now and in the future, both in X and in wayland, 
altho the specific details differ slightly.  And better news, while the 
details /do/ differ slightly on wayland from the split window-manager/
desktop-shell setup with X you describe below as your current setup, I'd 
not characterize it as more difficult.  Of course you lose some of the 
integration benefits but I'd guess you're already used to that with your 
current setup, and should be similarly able to deal with it. =:^)

More discussion below...

> To provide some context, currently I am on X11 using Plasma for my
> desktop with BSPWM as my window manager. I have a shoulder impingement
> which makes it painful to switch between keyboard and mouse frequently,
> so my ideal desktop is one that can be controlled as much as possible
> using either the keyboard *or* the mouse. It is not about keyboard VS
> mouse, I can use bothe devices just fine, it's about frequent switching.
> 
> The combo of Plasma and a tiling window manager meets my requirements
> perfectly because Plasma is very mouse-friendly, and BSPWM is very
> keyboard- havy. They complement each other perfectly. Unfortunately with
> the slow eventual death of X11 I will have to migrate to something else
> eventually and I would rather make plans now while I still have time.
> 
> My setup consists of two panels: one at the top containing an
> application menu, global menu, desktop pager, system tray and digital
> clock. The other panel is to the side, it contains an application
> dashboard, icons-only task manager, folder views and a waste bin.
> 
> I don't know much about Wayland beyond the surface-level information.
> Someone told me about the "layer shell" protocol which would allow
> panels to be used acros compositors, but I don't know if this applies to
> Plasma panels.
> 
> Is what i want possible, and if not will it be possible in the future?
> Hyprland has a plugin system, so if things like the global menu rely on
> extension to the Wayland protocol these could probably be implemented as
> a plugin in Hyprland. Of course I don't expect answers on how to
> integrate with the Hyprland side, I just want to know whether it is
> possible on the Plasma side. I can try to connect the wires myself once
> they are exposed.

So as you know wayland works somewhat differently than X, but it's 
probably worth going over the differences a bit more as we work toward 
understanding how the various components plug into the system, X vs. 
wayland.

Wayland is in fact the name given to the base-protocol, with various 
optional extensions at varying points in the xdg (freedesktop.org) 
standardization process.  Unlike X, where xorg is the default 
implementation and you pick a window manager component to put on top, 
there's no such default implementation for wayland (tho there is a 
reference implementation called weston, but it's designed as a basic 
reference implementation, not a full-featured compositor, and relatively 
few people run it).  Rather, each compositor (think super-window-manager 
that implements the base protocol and chosen extensions plus additonal 
security policy itself) is its own wayland implementation.

What's most important for this discussion is that wayland, being a window 
management and compositing protocol definition, does not define a desktop 
shell, that being out of scope for the protocol.  How each compositor 
implementation deals with desktop shell services is therefore left up to 
the compositor.  Weston being the basic reference implementation 
implements its own rather basic shell and I'm not sure they're separable, 
but certainly plasma (the desktop as a whole) still splits out the 
desktop-shell functionality and as a matter of practicality, I'd guess 
most full-featured implementations do as well.

In fact, as you will no doubt find pleasing since you're already familiar 
with it, plasma on wayland uses the exact same desktop shell, plasmashell, 
as it does on X.  Kwin works differently on wayland, combining plasma-on-
X's primarily window-manager kwin_x11 functionality with the wayland 
protocol implementation into the kwin_wayland compositor, and of course 
there's some minor differences in how plasmashell talks to kwin_wayland 
vs. how it talks to X and kwin_x11, but in general, plasmashell has very 
much the same user-facing functionality on both.

Which means from the plasma side, you *should* be able to use plasmashell 
as the desktop shell on at least *some* other wayland compositors very 
much as you already do on X with other window managers.  The extent to 
which that actually works, however, depends on the degree to which the 
other compositors split out and integrate their own shell components.

**Caveat:**  I've only personally used plasmashell with kwin_wayland (and 
previously with kwin_x11, of course).  While I know quitting and 
restarting plasmashell without bringing down the entire wayland session is 
possible and I actually do it (somewhat) routinely, thus demonstrating it 
isn't required for kwin_wayland functionality, *AND* I have weston 
installed and configured as a backup wayland compositor which I run from 
time to time, so I know how normal wayland-native and X (via xwayland) 
apps function on weston as well as kwin_wayland, I have **NOT** personally 
tried running plasmashell on anything but kwin_wayland, so don't actually 
know the degree to which plasmashell is kwin_wayland independent (the 
reverse of the kwin_wayland being plasmashell independent that I know to 
be the case since I do it).  But in theory it *should* work on other 
compositors, again, to the degree that the other compositor allows/
cooperates with it.

And I /believe/ that layer-shell-protocol extension is how the two 
(compositor and shell) would cooperate, to the degree that they do, but 
I've not looked into it beyond seeing the layer-shell-protocol mentions in 
the git logs (which I follow rather religously for plasma-workspace, 
plasma-desktop, kwin, and various kde frameworks, etc, as I'm actually 
running the live-git versions based on the gentoo/kde project overlay 
ebuilds).

Meanwhile, while I'm not familiar with Hyprland, I have seen some 
discussion of the wlroots modular wayland solution.  I don't know a lot 
about it, but from what I've read, it's a wayland-style extremely modular 
solution that allows you to pick and choose components from those 
available, much like one can build an X desktop from separate window 
manager, panel-app, app-launcher, hotkey-manager, tray/slit app, run-
dialog app, etc.  I don't believe any plasma components make wlroots 
compatibility claims or at least I've not seen any, but using wlroots-
compatible components I think it may be possible to build what you want, 
either without plasma components at all, or by filling in wlroots 
compatible components around plasmashell, for any missing functionality 
when running plasmashell in something other than a full plasma 
environment.

-- 
Duncan - List replies preferred.   No HTML msgs.
"Every nonfree program has a lord, a master --
and if you use the program, he is your master."  Richard Stallman



More information about the kde mailing list