nwg-piotr / nwg-hello

GTK3-based greeter for greetd written in python
MIT License
35 stars 5 forks source link

nwg-hello works with labwc too #16

Closed 01micko closed 3 months ago

01micko commented 3 months ago

Hello @nwg-piotr

I've been working on porting BunsenLabs, an openbox/debian based distro to labwc - which you may know is an openbox 'clone' (for want of a better term) for wlroots/wayland.

It works quite well as a replacement for sway/hyperland in the greetd configs to start nwg-hello.

I wrote about it on bunsen forums (includes configs and diffs) however the info doesn't pertain to the latest version but v0.1.10, the latest in the debian trixie repos as of now.

I wonder if you can add the info to the docs to help folk like me who had to use a bit of trial and error to get things working smoothly.

Thanks for reading.

nwg-piotr commented 3 months ago

Sure, but we would have to reconcile a few inconsistencies.

Apparently this can be cpoied to /etc/greetd/greetd.toml so it survives an upgrade.

The alternative config file name is greetd.conf, not greetd.toml.

Also, if possible, I'd prefer /etc/nwg-hello/ as the compositor config file location, as we already have hyprland and sway config there.

01micko commented 3 months ago

Thanks for consideration.

I'll make the necessary adjustments to my current system and post new configs in this thread.

nwg-piotr commented 3 months ago

Excellent, thanks!

01micko commented 3 months ago

Did the migration, now to test. If successful do you want me to issue a PR?

01micko commented 3 months ago

Interesting. greetd.conf ~doesn't work here. Maybe a debian quirk?~ sorry it does work.

Anyway the migration did work with greetd.toml, oh and screenshot saved in _greetd's home ;)

I have edited to use greetd.conf

list of /etc/greetd

mick@dellhome:~$ ls -l /etc/greetd/
total 128
-rw-rw-r-- 1 _greetd _greetd 119123 Jun  9 10:05 20240609_10h05m51s_grim.png
-rw-r--r-- 1 _greetd _greetd    669 Jun  7 22:33 config.toml.bak
-rw-r--r-- 1 _greetd _greetd    672 Jun  9 13:49 greetd.conf

list of /etc/nwg-hello

mick@dellhome:~$ sudo ls -l -R /etc/nwg-hello/
/etc/nwg-hello/:
total 76
-rw-r--r-- 1 root root   192 Apr 28 21:12 README
-rw-r--r-- 1 root root   175 Apr 28 21:12 hyprland.conf
drwxr-xr-x 2 root root  4096 Jun  9 09:40 labwc-config
-rw-r--r-- 1 root root 41190 Jun  8 10:05 labwall0-1920x1080.jpg
-rw-r--r-- 1 root root   897 Apr 28 21:12 nwg-hello-default.css
-rw-r--r-- 1 root root   496 Apr 28 21:12 nwg-hello-default.json
-rw-r--r-- 1 root root   906 Jun  8 10:12 nwg-hello.css
-rw-r--r-- 1 root root   497 Jun  8 11:10 nwg-hello.json
-rw-r--r-- 1 root root   213 Apr 28 21:12 sway-config

/etc/nwg-hello/lab-config:
total 8
-rw-r--r-- 1 root root  65 Jun  9 09:40 autostart
-rw-r--r-- 1 root root 175 Jun  9 09:40 rc.xml
01micko commented 3 months ago

configs

/etc/greetd/greetd.conf

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

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

command = "labwc --config-dir /etc/nwg-hello/labwc-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/labwc-config/autostart

# start nwg-hello - full paths aren't required, but saves lookup time
exec /usr/bin/nwg-hello; /usr/bin/labwc --exit

/etc/nwg-hello/labwc-config/rc.xml (optional)

 <?xml version="1.0" ?>
<labwc_config>

  <keyboard>
    <default />
    <keybind key="Print"><action name="Execute" command="grim" /></keybind>
  </keyboard>

</labwc_config>
01micko commented 3 months ago

Did tests on my troublesome HP laptop. lightdm would get stuck in a login loop - so switch vt and reboot was the only way out.

No such troubles with nwg-hello :)

01micko commented 3 months ago

BTW, the user _greetd is a debian thing, even though it isn't set up correctly. I have to manually add to 'video' group and chown all the files in /etc/greetd

nwg-piotr commented 3 months ago

I've added the info you provided to README.md. Check if it looks well enough, please.

01micko commented 3 months ago

Looks fine :) Thanks! I'll close the issue.

johnraff commented 2 months ago

BTW, the user _greetd is a debian thing, even though it isn't set up correctly. I have to manually add to 'video' group and chown all the files in /etc/greetd

It's also necessary to chown _greetd:_greetd /var/cache/nwg-hello/cache.json in order for the previous session to be displayed.

01micko commented 1 month ago

Interesting that on my debian box I don't need this,

mick@dellhome:~$ ls -l /var/cache/nwg-hello/
total 4
-rw-r--r-- 1 root root 2 Jun 23 17:29 cache.json
mick@dellhome:~$ cat /var/cache/nwg-hello/cache.json 
{}mick@dellhome:~$ 

On my HP laptop I did, built from a bunsen-netinstall, had to reboot for it to work.