rharish101 / ReGreet

Clean and customizable greeter for greetd
GNU General Public License v3.0
348 stars 16 forks source link

Support for clamshell mode laptops? #23

Closed AjiBuster499 closed 1 year ago

AjiBuster499 commented 1 year ago

Hello, when at home I typically use my laptop in clamshell mode, where the laptop itself is closed and I use an external monitor as my primary monitor. I've tried using ReGreet lately, and while I like it, the (unused) laptop screen seems to be set as primary, and so I cannot actually see the login screen.

Would it be possible to add support for such a laptop setup? I have no experience in this kind of application, but I was wondering if it could be as simple as setting a primary screen in settings, or something to that effect?

fufexan commented 1 year ago

I think this is up to the underlying compositor to configure. So if you use Sway to run ReGreet, you would have to search how to use Sway in clamshell mode. I suggest looking into kanshi for automatic display configuration based on rules you set.

AjiBuster499 commented 1 year ago

I'm not entirely sure it's the compositor. I was using GTKGreet before switching to ReGreet, and it handled clamshell mode just fine. I have the snippet from Sway's wiki about running clamshell mode in the greeter-sway's config, which was there with GTKGreet too. Snippet in question:

set $laptop eDP-1
bindswitch --reload --locked lid:on output $laptop disable
bindswitch --reload --locked lid:off output $laptop enable

However, when I use ReGreet, if the laptop is closed the greeter does not switch to the external monitor, and in fact as far as I can tell the greeter isn't even responding; if try to log in "blind" following the normal keystrokes needed, the external monitor continues to be grey (indicating a failure to log in), and even if I open the laptop lid (and therefore enable laptop output), ReGreet won't appear on either screen. I have to reboot with the lid open until ReGreet loads in order to actually log in. Hence why I think it's a ReGreet issue, and not a compositor issue. With GTKGreet the greeter would load on the external monitor when in clamshell mode without issue.

rharish101 commented 1 year ago

In that case, I'll have to investigate how GTKGreet handles this, since I was under the impression that it's just a simple GTK3 window, similar to ReGreet (which is GTK4).

rharish101 commented 1 year ago

@AjiBuster499 could you test ReGreet from PR #25? I don't have a proper multi-monitor setup, so I can't fully test this.

AjiBuster499 commented 1 year ago

Hi, I just tested it. It did not work, the external monitor had the grey "secondary screen" background, and also based on the mouse being limited to just the external monitor, was the only one it recognized. However ReGreet did not show up on either display, and I had to reboot and keep the lid open to log in successfully like without the PR.

However, I think the PR did restrict it to one display like I said, because if I recall correctly, the main branch allows me to move my mouse between both screens, even though ReGreet doesn't appear on either of them.

EDIT: the main branch regreet-git in the AUR, also only recognizes one display when the lid is closed, but recognizes both when the lid is open, however ReGreet won't appear on either. So nothing has particularly changed.

rharish101 commented 1 year ago

@AjiBuster499 Could you try the newest commit on #25 and upload the logs (when running ReGreet with -l debug)?

AjiBuster499 commented 1 year ago

Hello, sorry for the delay, it's finals season and I've been focused on other things.

Here is the log, I excluded the lines that weren't from the run with -l debug.

This time, ReGreet appeared on my external monitor after a short delay, although the UI was in light mode.

rharish101 commented 1 year ago

@AjiBuster499 Try the latest commit to see if everything works as intended.

AjiBuster499 commented 1 year ago

It is in dark mode now, so I do believe everything is working.