JezerM/nody-greeter

Multi-Monitor Support

Closed this issue ยท 2 comments

s0 commented

Environment

  • N/A

Description of feature

I would like it to be possible for nody-greeter to open an electron BrowserWindow for each monitor / display that a user may have. I have a multi-monitor setup, and would like to create a theme that displays different information on each monitor, one of which will allow the user to log-in.

This would also allow for multi-monitor backgrounds to be displayed if themes could be configured to display different parts of a multi-monitor background on different displays. (I have plans for an animated SVG multi-monitor background to display behind my login screens, probably not too dissimilar to my website wallpaper here: https://samlanning.com/

Possible solutions

I have already got a quick hacky solution working locally, but it wouldn't need too much cleanup before being PR-able I would say.

(I also have to say @JezerM, it was very quick to figure out how to start playing round with the code, thanks for keeping it clean and simple! I've wanted to play around with an electron and node based greeter for a while, and it's great to see it happening!)

It would roughly work by:

  • creating an individual BrowserWindow for each display in screen.getAllDisplays()
  • passing metadata to each browser window (probably via _emit_signal) that includes:
    • the monitor ID,
    • whether the monitor is primary
    • dimensions of the full set of moitors, and the position & size of the relevant monitor
  • updating _emit_signal to send signals for every monitor
  • (optional) allow for cross-window communication between BrowserWindows, for example if a theme allows changing a wallpaper in one window, it may need to notify other windows.

Then the default themes could be updated to only display the UI elements on the primary monitor, and display wallpaper only on other monitors.

If you're not opposed, I'd love to have a crack at this?

Cheers, and thanks again for the wonderful work!

Greetings! I always thought about a multi-monitor support and how I could implement it, but it seemed impossible to me as I don't have a multi-monitor setup. I couldn't test this (I guess), but sure it would be interesting and useful to have~

I see two problems that seem important to have a proper multi-monitor support:

  • Communication between windows.
    • Provide an API to communicate between them. (Optional)
    • Update signals on every window and therefore LightDM API should be accessible on all windows.
  • Identify the monitors and set their webpages according to their "priority" (whether it is the main monitor or not).
    • Maybe provide an index.theme like configuration (from lightdm-webkit2-greeter) to configure which html files would correspond to every monitor.

I'm glad that someone put interest on this! So, if you're going to put your effort on this feature, I'm here to help~

s0 commented

@JezerM awesome, i'll get started on it today! ๐Ÿ˜„