JezerM / nody-greeter

LightDM greeter that allows to create wonderful themes with web technologies. Made in Node.js
https://web-greeter-page.vercel.app
GNU General Public License v3.0
134 stars 9 forks source link

Multi-monitor support #11

Closed s0 closed 2 years ago

s0 commented 2 years ago

closes #10

There are a couple of commits I also added to ease development a little bit (638c8524ebc6cc429968dd14faebf31034a410a8, 0d16e9dfa256c7b1dcc6d0fe42b5d685b666494d), I can more them to another PR or just remove if you'd prefer.

This is an initial implementation for multi-monitor support, that seems to be working quite well on my setup. I've included the ability for themes to get metadata about their window, including whether or not they're primary, and have hidden the login components for non-primary screens on the default themes.

I haven't yet implemented cross-window communication, but wanted to get this PR open as a draft before that to make sure that you're happy i'm on the right track. That's the last remaining part, and i'll use the dracula background-switcher as a demo of this functionality.

TODO:

s0 commented 2 years ago

Thanks for the initial review! Also noticed you introduced linting and formatting, very nice to see! I've incorporated your suggestions in a rebase, and also ensured that it's formatted + linted throughout the history.

I also spotted a bug where if a frame is reloaded (via ctrl+R, or via theme reloading etc...), then it won't initialize as metadata isn't sent more than once, so i'm going to look at fixing that now by having the theme frame request the metadata and sending it then, tracked this in a TODO above.

s0 commented 2 years ago

Okay I've now updated the PR addressing the refresh bug, and allowing cross-window communication via a broadcast mechanism. This mechanism is then also used in the dracula theme to apply wallpaper changes across all screens.

Other than the open question around handling of a secondary URL, i think this is ready to go now :)

JezerM commented 2 years ago

Now, nody-greeter will look for index.theme (still not sure about the name) inside the theme's directory, if it does exist then it will be loaded and used to set primary_url and secondary_url for all monitors. However, if the secondary_html property does not exist, it will fallback to the primary_html.

JezerM commented 2 years ago

I just added the secondary.html and index.theme for both gruvbox and dracula themes.

Added a "fake" display to test it locally, and yeah, it works!

https://user-images.githubusercontent.com/59768785/149647671-5e6356b1-8284-4c5f-bd87-baa8b5109d4d.mov

JezerM commented 2 years ago

io-ts looks interesting, powerful and easy to use. I did a little implementation with both greeter and theme's config, but I'd like you to check if this is correct or there's any improvement to be made.

s0 commented 2 years ago

Just my one comment regarding undefined above probably needs to be addressed, then i think this is ready to go! :) Happy to defer the conversation around sync / async I/O operations to #13

JezerM commented 2 years ago

Nice~ It looks better and simpler. Now, I'm going to check if there's any issue or anything to be improved before I merge this PR.

s0 commented 2 years ago

Nice~ It looks better and simpler. Now, I'm going to check if there's any issue or anything to be improved before I merge this PR.

Sweet! Excited to get this in! And thanks for being an easy maintainer to work with!