You are not logged in.

#1 2024-07-22 09:29:18

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 12,553
Website

Organizing the Carbon BunsenLabs sessions for Wayland and X11

bunsen-configs for wayland

Let me get this suggestion down now while I still remember it. roll
A way, on BL Carbon, that we could set up a testing wayland system alongside a default X11 system.
@malm had some very helpful suggestions here:
https://forums.bunsenlabs.org/viewtopic … 31#p136031
but I'm reading that as more aimed at people who are working most of the time on labwc and integrating it into Debian, and what they can do right now. I'm thinking more from the BL side, what we can reasonably aim for in the Carbon release, probably some time next year.

OK for our Carbon release, unless the Debian Wayland environment changes drastically over that time, it looks as if our default system will remain X11 based. At the same time, we want to make it as easy as possible for users to try out Wayland.
As @malm said:

malm wrote:

a bolt-on for users to evaluate

Wayland/Carbon might turn out to be very basic, or might be almost as usable as X11/Carbon, we'll have to wait and see. But I think we could reasonably make the default BL Carbon install - iso or netinstall - X11 based, as it is now. That makes some things easier:
a) We don't have to worry about finding a new Display Manager - lightdm is capable of launching a Wayland session from a .desktop file in /usr/share/wayland-sessions and the X11 packages it needs are already installed. Bloat isn't really a problem at this stage.
b) Exactly how to divide up bunsen-configs into X11 and Wayland sections can be put off till maybe Nitrogen. Let's just add-on the Wayland config files when someone sets up a tryout session.

Maybe like this?

1) bunsen-configs remains as it except that the session files are slightly tweaked so that if a Wayland session is invoked, the right autostart files will be called. X11 sessions won't change at all.

2) A new package bunsen-configs-wbase will be created which holds the config files our Wayland people decide are needed for a basic Wayland session, along with the .desktop file to go in /usr/share/wayland-sessions. Shipping the .desktop file in this package means that regular X11 users who don't install bunsen-configs-wbase won't see an annoying non-working "bunsenlabs wayland session" login option. bunsen-configs-wbase will not conflict with bunsen-configs: both packages can be installed together.

3) A new metapackage bunsen-meta-wbase. I think we can make it a Recommends of bunsen-configs-wbase, but bunsen-meta-wbase can have bunsen-configs-wbase as a Depends. So the basic list of packages gets installed.

So a Carbon (X11) user could install bunsen-meta-wbase, reboot and see the Wayland session offered at the login screen, along with the existing X11 session.

I think that might make the Carbon Wayland session a usable bolt-on for the X11 setup?

I've probably forgotten something...

Last edited by johnraff (2024-07-24 06:16:14)


...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )

Introduction to the Bunsenlabs Boron Desktop

Offline

#2 2024-07-22 09:57:04

PackRat
jgmenu user Numero Uno
Registered: 2015-10-02
Posts: 2,611

Re: Organizing the Carbon BunsenLabs sessions for Wayland and X11

Looks like a sound plan.


You must unlearn what you have learned.
    -- yoda

Online

#3 2024-07-22 11:30:37

unklar
Back to the roots 1.9
From: #! BL
Registered: 2015-10-31
Posts: 2,645

Re: Organizing the Carbon BunsenLabs sessions for Wayland and X11

johnraff wrote:

a) We don't have to worry about finding a new Display Manager - lightdm is capable of launching a Wayland session from a .desktop file in /usr/share/wayland-sessions and the X11 packages it needs are already installed. Bloat isn't really a problem at this stage.
b) Exactly how to divide up bunsen-configs into X11 and Wayland sections can be put off till maybe Nitrogen. Let's just add-on the Wayland config files when someone sets up a tryout session.

As far as I know, lightdm does not work with wayland.
https://wiki.archlinux.org/title/Waylan … y_managers
@micko01 therefore uses 'greetd'.

It looks similar with 'nitrogen'. Here he uses 'azote'.

Last edited by unklar (2024-07-22 11:31:28)

Offline

#4 2024-07-22 17:48:39

hhh
Gaucho
From: High in the Custerdome
Registered: 2015-09-17
Posts: 16,032
Website

Re: Organizing the Carbon BunsenLabs sessions for Wayland and X11

PackRat wrote:

Looks like a sound plan.

Agreed!

unklar wrote:
johnraff wrote:

a) We don't have to worry about finding a new Display Manager - lightdm is capable of launching a Wayland session from a .desktop file in /usr/share/wayland-sessions and the X11 packages it needs are already installed. Bloat isn't really a problem at this stage.
b) Exactly how to divide up bunsen-configs into X11 and Wayland sections can be put off till maybe Nitrogen. Let's just add-on the Wayland config files when someone sets up a tryout session.

As far as I know, lightdm does not work with wayland.
https://wiki.archlinux.org/title/Waylan … y_managers
@micko01 therefore uses 'greetd'.

It looks similar with 'nitrogen'. Here he uses 'azote'.

greetdm and gdm3 can run on an only-Wayland system, but we're talking about a system like what's happening with GNOME and KDE in Debian right now... the OS contains both Wayland and Xorg packages and can run both sessions. For example, the bookworm GNOME ISO installation defaults to gdm3 running on Wayland, but you can configure it to use Xorg, and you can login to either an Xorg or a Wayland session from either a Wayland or an Xorg greeter (although I haven't tested it).


No, he can't sleep on the floor. What do you think I'm yelling for?!!!

Offline

#5 2024-07-22 20:17:11

PackRat
jgmenu user Numero Uno
Registered: 2015-10-02
Posts: 2,611

Re: Organizing the Carbon BunsenLabs sessions for Wayland and X11

hhh wrote:

you can login to either an Xorg or a Wayland session from either a Wayland or an Xorg greeter (although I haven't tested it).

Last time I tried Debian with Gnome that was the case, i3 was the X window manager. That was quite a while ago just to give Wayland a peek. I like to think it's only improved with time.

sddm can handle both Wayland and Xorg, but pulls a lot of qt dependencies. Would really add to the iso size.


You must unlearn what you have learned.
    -- yoda

Online

#6 2024-07-22 23:28:03

hhh
Gaucho
From: High in the Custerdome
Registered: 2015-09-17
Posts: 16,032
Website

Re: Organizing the Carbon BunsenLabs sessions for Wayland and X11

PackRat wrote:

sddm can handle both Wayland and Xorg, but pulls a lot of qt dependencies. Would really add to the iso size.

Yeah, BL probably has some of them already because of vlc media player, but switching DMs for this is too much work. If lightdm doesn't work just drop to TTY, login and run labwc.


No, he can't sleep on the floor. What do you think I'm yelling for?!!!

Offline

#7 2024-07-23 03:12:49

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 12,553
Website

Re: Organizing the Carbon BunsenLabs sessions for Wayland and X11

I've got a VM almost ready# to confirm/deny whether lightdm can launch a Wayland session. I'm pretty sure it will be OK if there is already a working X11 session too. Remains also to test whether X11 continues to run - just for lightdm - after logging into the Wayland session, and if so, how much extra RAM and CPU it uses...

# What's holding me up is that there doesn't seem to be a spice-vdagent for Trixie atm, making simple copy/paste into files impossible. Have to set up SSH or make a temporary .deb package or something, since I don't feel like editing the BL session files by hand.


...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )

Introduction to the Bunsenlabs Boron Desktop

Offline

#8 2024-07-23 03:26:34

hhh
Gaucho
From: High in the Custerdome
Registered: 2015-09-17
Posts: 16,032
Website

Re: Organizing the Carbon BunsenLabs sessions for Wayland and X11

johnraff wrote:

Remains also to test whether X11 continues to run - just for lightdm - after logging into the Wayland session...

Hadn't thought about that. I would think lightdm exits when the Wayland session begins, and then restarts when the Wayland session ends, but I don't know. I wouldn't get my hopes up about light-locker working via Xwayland, though. swaylock and hyprlock are being developed for wlroots compositors for a reason.


No, he can't sleep on the floor. What do you think I'm yelling for?!!!

Offline

#9 2024-07-23 03:56:54

hhh
Gaucho
From: High in the Custerdome
Registered: 2015-09-17
Posts: 16,032
Website

Re: Organizing the Carbon BunsenLabs sessions for Wayland and X11

OK, I install lightdm-gtk-greeter on the old Ideapad 110 my friend lent me. I tought lightdm was a dependency of that, apparently not, but desktop-base is, that's a package I should add to my little tutorial.

Installing lightdm brings in Xorg, labwc is listed as a session. Pick it! If you leave it on "Default session" its starts that zombie session which, thankfully, at least opens a terminal (with no decorations or borders) so ou can run "sudo pkill lightdm" and get out of there.

Choosing labwc, all looks good...

sgXWdNft.png

I'll test light-locker tomorrow, but I really doubt it will work.


No, he can't sleep on the floor. What do you think I'm yelling for?!!!

Offline

#10 2024-07-23 04:07:52

hhh
Gaucho
From: High in the Custerdome
Registered: 2015-09-17
Posts: 16,032
Website

Re: Organizing the Carbon BunsenLabs sessions for Wayland and X11

^ Yeah, scratch that. It only works after a fresh boot for me, after that it just goes back to the login screen. Dropping to TTY works fine, though.


No, he can't sleep on the floor. What do you think I'm yelling for?!!!

Offline

#11 2024-07-23 06:42:51

unklar
Back to the roots 1.9
From: #! BL
Registered: 2015-10-31
Posts: 2,645

Re: Organizing the Carbon BunsenLabs sessions for Wayland and X11

johnraff wrote:

# What's holding me up is that there doesn't seem to be a spice-vdagent for Trixie atm, making simple copy/paste into files impossible. Have to set up SSH or make a temporary .deb package or something, since I don't feel like editing the BL session files by hand.

With the sshd.service, this is very easy in BL. In the host

systemctl status sshd.service

if it is not running, then

systemctl start sshd.service

In the client (VM) --> enter thunar in the address line ip of the host

sftp://unklar@192.168.178.45/

PW, done.  smile

Offline

#12 2024-07-23 07:08:42

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 12,553
Website

Re: Organizing the Carbon BunsenLabs sessions for Wayland and X11

^thanks! I'll give that a try next time.
This time I just logged into the VM's IP with a terminal in the host:

ssh john@192.168.122.56

And then ran

nano <file>

Because the terminal is in the host not the guest, it accepts pasting in of code with Ctrl+Shift+V (or whatever it is for that terminal), so it wasn't too hard. smile


...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )

Introduction to the Bunsenlabs Boron Desktop

Offline

#13 2024-07-23 08:22:34

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 12,553
Website

Re: Organizing the Carbon BunsenLabs sessions for Wayland and X11

It's not going to be that simple.

Lightdm started the Wayland session but it stayed around along with its gtk-greeter, using a fair chunk of RAM between them. The X server was also running as well as labwc, so it's all a bit messy.

Also, I got a double cursor and various other minor bugs.

Likely switching to another display manager for both X11 and Wayland on Carbon will be the way to go - unless lightdm improves.

Install htop and pstree (from psmisc) to get an idea what's going on, and xeyes (from x11-apps) to see which windows are native Wayland (the eyes move when the cursor is in an X window).

Last edited by johnraff (2024-07-24 05:54:49)


...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )

Introduction to the Bunsenlabs Boron Desktop

Offline

#14 2024-07-23 10:08:56

micko01
void main()
From: Queensland, Australia
Registered: 2024-04-07
Posts: 492
Website

Re: Organizing the Carbon BunsenLabs sessions for Wayland and X11

^ ^^^^ ^^^^^The big problem with all graphical login managers is that they rely on a graphical server of some sort. That is not good for X or wayland IMHO.

I have searched far and wide for an SDL2 session manager but as far as I have found, nothing exists. If my C++ wasn't as rusty as a cast iron anchor under the Dead Sea I'd have a go at writing my own!

There are some ncurses based, certainly not pretty but certainly functional. Maybe an option.

There is also DRM as a possibility for writing a dm, (plymouth needs that - so why not use it for a session manager?) but in my case it would be my ambition far out stripping my capabilities.

Framebuffer should work too, but really I'm digressing here.

What we need is to see how the raspberry pi folk get labwc/wayfire/sway/etc working with lightdm - and if it works just as well with X. However, it may not be too helpful as raspberry-pi-os is particular for a few pieces of armhf/aarch64 hardware.

As I've said before, labwc refuses to start from lightdm (as it is now) on my oldish HP laptop, Pavillion G6; get's stuck in a "login" loop, much as @hhh describes 4 or so posts back.

The search continues.


#!/bin/sh
echo '#include <stdio.h>\nvoid main() { printf("Hi, bunsenlabs\\n"); return; }' > bunsen.c
gcc bunsen.c -o bunsen
./bunsen

Offline

#15 2024-07-24 07:01:05

unklar
Back to the roots 1.9
From: #! BL
Registered: 2015-10-31
Posts: 2,645

Re: Organizing the Carbon BunsenLabs sessions for Wayland and X11

Temporarily, you can also leave the start in carbon on tty1 by entering 'labw' or 'openbox-session'...
This should not be difficult for a Linux user.  smile

Offline

#16 2024-07-24 07:03:52

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 12,553
Website

Re: Organizing the Carbon BunsenLabs sessions for Wayland and X11

micko01 wrote:

The big problem with all graphical login managers is that they rely on a graphical server of some sort. That is not good for X or wayland IMHO.

My grasp is weak, but I think on X11 a server has to be running first, and apps can open windows there. So any DM has first to call for an X server to run in. Since no user is logged in at that point, it means running the X server as root. Lightdm (and presumably the others) seems to be mitigating the security risk by running as user "lightdm". Once a user is logged in, I think ownership of the X server is passed to that user - but I'm not sure at all how that would be done. I know you can log in on a TTY and then run 'startx' to get a user-owned X server - in fact several users can do that at the same time.

Now, on Wayland, I don't think there's a "Wayland" server at all. (Please correct me, anyone who knows better.) The compositor, eg labwc, is also the server, right? So a DM that runs on Wayland like GDM is itself behaving like a compositor, because no other compositor is running at that point, right? But I don't know what GDM does once a user has logged in and started up some other compositor. Does it shut down, or linger in the background?

And what does GDM do if it finds no Wayland libraries, but only X11 ones? Does it support two separate operating modes and switch between? If both X11 and Wayland are available, which does it choose to run on? Can it launch an X11 session while running on Wayland? More potentially useful for us would be if  GDM already configured on X11 were able to launch a nicely working Wayland session.

Even better, if lightdm could be persuaded to do the job, save us from reconfiguring our whole login to make Wayland possible.

People are working on getting lightdm to run on Wayland, which might improve the situation some day: https://github.com/canonical/lightdm/issues/267

micko01 wrote:

As I've said before, labwc refuses to start from lightdm (as it is now) on my oldish HP laptop, Pavillion G6; get's stuck in a "login" loop, much as @hhh describes 4 or so posts back.

Error logs somewhere?

unklar wrote:

As far as I know, lightdm does not work with wayland.
https://wiki.archlinux.org/title/Waylan … y_managers
@micko01 therefore uses 'greetd'.

I forgot to reply to this earlier, but the Arch Wiki is in fact saying "Display managers listed below support launching Wayland compositors" including lightdm. But what lightdm does not do is "run itself on Wayland".


...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )

Introduction to the Bunsenlabs Boron Desktop

Offline

#17 2024-07-24 07:39:54

unklar
Back to the roots 1.9
From: #! BL
Registered: 2015-10-31
Posts: 2,645

Re: Organizing the Carbon BunsenLabs sessions for Wayland and X11

Xwayland is a dependency in labwc.

When searching for the differences between wayland and xwayland I found:

https://forums.bunsenlabs.org/viewtopic … 61#p132761

Ergo, "no x-server" is provided in the wayland protocol.  sad

Offline

#18 2024-07-24 15:44:47

hhh
Gaucho
From: High in the Custerdome
Registered: 2015-09-17
Posts: 16,032
Website

Re: Organizing the Carbon BunsenLabs sessions for Wayland and X11

johnraff wrote:

So a DM that runs on Wayland like GDM is itself behaving like a compositor, because no other compositor is running at that point, right? But I don't know what GDM does once a user has logged in and started up some other compositor. Does it shut down, or linger in the background?

It lingers in the background. On my hyprland setup that uses gdm3 to login, 'gdm-wayland-session' shows in my system monitor as sleeping.


No, he can't sleep on the floor. What do you think I'm yelling for?!!!

Offline

#19 2024-07-25 01:29:25

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 12,553
Website

Re: Organizing the Carbon BunsenLabs sessions for Wayland and X11

^Is that sleeping gdm3 using any significant RAM or CPU?

I think my test with lightdm must be misconfigured somewhere because, apart from the double cursor, lightdm and X11 are using a big ~4.5% of available RAM after login. No good.


...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )

Introduction to the Bunsenlabs Boron Desktop

Offline

#20 2024-07-25 06:30:07

micko01
void main()
From: Queensland, Australia
Registered: 2024-04-07
Posts: 492
Website

Re: Organizing the Carbon BunsenLabs sessions for Wayland and X11

This is interesting, running greetd(login daemon) -->labwc(server to start graphical greeter) -->nwg-hello(graphical greeter)

mick@dellhome:~$ pidof greetd
1264 878                                      ### 2 pids, dunno why
mick@dellhome:~$ pidof labwc
1328                                              ### 1 pid to be expected as I'm running it now posting this
mick@dellhome:~$ pidof nwg-hello
mick@dellhome:~$                        ### nothing as it quits as soon as soon as it's finished it's job, then labwc quits as instructed.
mick@dellhome:~$ top -p 1264,878   ### the 2 pids of greetd
Tasks:   2 total,   0 running,   2 sleeping,   0 stopped,   0 zombie
%Cpu(s):  0.2 us,  0.1 sy,  0.0 ni, 99.7 id,  0.0 wa,  0.0 hi,  0.0 si,  0.0 st 
MiB Mem :   7740.9 total,   4681.3 free,   1961.9 used,   1741.4 buff/cache     
MiB Swap:   3051.0 total,   3051.0 free,      0.0 used.   5779.0 avail Mem 

    PID USER      PR  NI    VIRT    RES    SHR S  %CPU  %MEM     TIME+ COMMAND  
   1264 root      20   0    9036   8960   7656 S   0.0   0.1   0:00.03 greetd   
    878 root      20   0    3656   3584   3072 S   0.0   0.0   0:00.00 greetd   

greetd is started as as root as you can see in the top . I would suppose there are 2 pids for keeping itself alive and taking care of the session. I'll have to read up on that.

UPDATE.

The output of ps axu explains the 2 pids, one for greetd to start and run, the other for the session.

mick@dellhome:~$ ps axu|grep greetd
root         878  0.0  0.0   3656  3584 ?        SLs  15:05   0:00 greetd
root        1264  0.0  0.1   9036  8960 tty7     SLs+ 15:05   0:00 /usr/sbin/greetd --session-worker 12
mick       13576  0.0  0.0   6384  2176 pts/2    S+   17:28   0:00 grep greetd

Here's how I start it

/etc/greetd/greetd.conf

[terminal]
#  can use any VT, on my lappy I use VT = 1
vt = 7

[default_session]
command = "labwc --config-dir /etc/nwg-hello/lab-config"

# The user to run the command as. The privileges this user must have depends
# on the greeter. A graphical greeter may for example require the user to be
# in the `video` group.
user = "_greetd"

/etc/nwg-hello/lab-config/autostart

# start nwg-hello
exec /usr/bin/nwg-hello; /usr/bin/labwc --exit

So, the logic is,

  • systemd is configured to start greetd

  • greetd starts labwc with the config in /etc/nwg-hello/lab-config

  • labwc starts nwg-hello

  • lnwg-hello finishes and labw dies gracefully

It wasn't documented anywhere how to start labwc with greetd and subsequently start mwg-hello, I took that on as an exercise and it wasn't that difficult.

https://man.sr.ht/~kennylevinsen/greetd/

Last edited by micko01 (2024-07-25 07:37:29)


#!/bin/sh
echo '#include <stdio.h>\nvoid main() { printf("Hi, bunsenlabs\\n"); return; }' > bunsen.c
gcc bunsen.c -o bunsen
./bunsen

Offline

Board footer

Powered by FluxBB