apognu / tuigreet

Graphical console greeter for greetd
GNU General Public License v3.0
938 stars 41 forks source link

Xsessions are not starting properly #120

Closed Goosegit11 closed 5 months ago

Goosegit11 commented 9 months ago

15

92

I have two sessions in /usr/share/xsessions, and for example dwm's one says Exec=dwm. In tuigreet I have these two sessions listed but they don't work, because Xorg is not started before them.

Currently I'm manually changing cmd to startx which is starting Xorg and then dk window manager. Variables like XDG_CURRENT_DESKTOP are not set.

I realize I can create wrapper scripts for this purpose, but they seem like a dirty hack to me.

Quoting @xukai92 from issue #15:

The annoying thing is that those X sessions that doesn't work would still be listed by tuigreet. I really want to make everything listed work fine. Could I make tuigreet somehow handle X sessions and wayland sessions differently?

Goosegit11 commented 9 months ago

Example xsession .desktop file:

[Desktop Entry]
Encoding=UTF-8
Name=dwm
Comment=Dynamic window manager
Exec=dwm
Icon=dwm
Type=XSession

greetd config.yml:

[terminal]
# The VT to run the greeter on. Can be "next", "current" or a number
# designating the VT.
vt = 1

# The default session, also known as the greeter.
[default_session]

# `agreety` is the bundled agetty/login-lookalike. You can replace `/bin/sh`
# with whatever you want started, such as `sway`.
# command = "agreety --cmd /bin/sh"
command = "tuigreet"

# 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 = "greeter"
apognu commented 9 months ago

Which version of tuigreet are you using? The release built from master should have fixed this. If not, we'll look into it.

Goosegit11 commented 9 months ago

I'm using greetd-tuigreet 0.8.0-2 package from Arch Linux extra repository

apognu commented 9 months ago

Indeed, with that version, the only option to do what you want is wrapper scripts. The master branch has changes to try and automate X server startup when appropriate, but it is not yet released.

I am hoping to release it early 2024 when I am back from vacation, but if you want to give it a test run and give feedback, you can download the binary from the release section.

Goosegit11 commented 9 months ago

but if you want to give it a test run and give feedback, you can download the binary from the release section.

I don't get it.

In Github Releases section, the latest version is 0.8.0: https://github.com/apognu/tuigreet/releases/latest

And mine is 0.8.0-2 (maybe even newer?)

There's three tuigreet packages in Arch Linux: aur/greetd-tuigreet-git 0.8.0.r1.gd464546-0 aur/greetd-tuigreet-bin 0.8.0-0 extra/greetd-tuigreet 0.8.0-2 (what I have)

I'll try the git package

apognu commented 9 months ago

A prerelease is continuously built from the tip of the master branch here with the latest yet-unreleased changes.

Note that this build could contain more bugs than a released version, so tread carefully.

deej-io commented 6 months ago

Just wanting to weigh in and say that I had this issue. I installed greetd-tuigreet-git from the AUR and it worked as expected. Would be great to get a proper release out with this fix so it can be packaged in the official repos.

Cheers!

Goosegit11 commented 6 months ago

I use greetd-tuigreet-git with Cinnamon, but it is not suitable for release IMO.

Some environment variables are not set, for example DESKTOP_SESSION=cinnamon XDG_SESSION_DESKTOP=cinnamon

It appears that neither .xinitrc nor .xsession are used, as the commands I put there do not execute, so I have to type things like source .xsession every time I start Cinnamon.

Xresources are not loaded, so I have to type xrdb .Xresources (or put them in the .xsession and then source .xsession, doesn't matter).

And I think the problem is not with Cinnamon, because with other display managers everything is fine.

RayZ0rr commented 5 months ago

I have made instructions on making greetd greeters work with X11 sessions here: https://www.reddit.com/r/linux/comments/1c8zdcw/using_x11_window_managers_with_greetd_login/

Goosegit11 commented 5 months ago

@RayZ0rr

I really liked your post, but there is one problem.

I want to have multiple DE/WMs in my tuigreet menu, and .xinitrc won't work for that because I have to change the .xinitrc every time I need to run a different WM

If you could make it work, that would be really great.

RayZ0rr commented 5 months ago

@Goosegit11

This is possible.

See this instruction in Arch Wiki

You can create different .desktop files that pass different arguments to start

apognu commented 5 months ago

After some time off GitHub, I am starting work on this again and will package the next stable version (also, uzers-rs finally tagged a release with some of my contributions, so there is no blocked).

apognu commented 5 months ago

I use greetd-tuigreet-git with Cinnamon, but it is not suitable for release IMO.

Some environment variables are not set, for example DESKTOP_SESSION=cinnamon XDG_SESSION_DESKTOP=cinnamon

It appears that neither .xinitrc nor .xsession are used, as the commands I put there do not execute, so I have to type things like source .xsession every time I start Cinnamon.

Xresources are not loaded, so I have to type xrdb .Xresources (or put them in the .xsession and then source .xsession, doesn't matter).

And I think the problem is not with Cinnamon, because with other display managers everything is fine.

I will look into properly setting the environment defined in the session.

I don't know that it is the responsibility of the greeter to load those files, though. Even if I wanted to, those live in the home directory, which the user tuigreet runs as cannot read. I'll look into what other greeters do.

apognu commented 5 months ago

HEAD and the tip release should now properly set the environment variables following the session file (XDG_SESSION_DESKTOP, DESKTOP_SESSION and XDG_CURRENT_DESKTOP). Could you try it out whenever is convenient?

apognu commented 5 months ago

This is now part of the new 0.9.0 release.

I do think the initial topic of this thread was resolved by a few commits since the previous release. Feel free to respond here if you do not agree or feel this is still missing something.