nwg-piotr / nwg-hello

GTK3-based greeter for greetd written in python
MIT License
26 stars 4 forks source link

Feature request: specify monitor for login window #12

Closed BluishHumility closed 1 month ago

BluishHumility commented 1 month ago

Hello,

In a multi-monitor setup, the Greeter displays on all monitors. It would be a nice touch if the login elements could be displayed on a user-specified monitor instead of all monitors, and the remaining displays would show the wallpaper only (kind of how SDDM does it).

There is a monitor_nums option available, but when this is set the excluded displays do not show the wallpaper (they show a grey background).

nwg-piotr commented 1 month ago

The program does not care about the displays you exclude it from working on.

BluishHumility commented 1 month ago

The program does not care about the displays you exclude it from working on.

Of course not! I apologize, I can see I have not been clear with the feature request.

What I meant to describe is an option to allow the login elements, such as the little boxes where you enter the user name and password and such, to only display on a designated monitor. These are the login elements I am referring to, highlighted in this picture here:

image

In other words, the display would come up and show the user's wallpaper, but only the specified display would have the actual menu to log in with.

What I am picturing would be another option exposed to the user in nwg-hello.json. For example, to have the greeter on all displays but the login elements only on display 0:

  "monitor_nums": [],
  "login_nums": 0,

Or perhaps a display could be allowed to have a separate nwg-hello.css configuration. For example, to have two displays, display0 with the login elements and display1 with only a wallpaper:

/* Styles for display 0 */
.display0 window {
    background-image: url("/usr/share/wallpapers/garuda-wallpapers/Black Eagle.png");
    background-size: 100% 100%;
}

.display0 #form-wrapper {
    background-color: rgba(0, 0, 0, 0.2);
}

.display0 entry {
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid #eee;
    border-radius: 18px;
    padding: 12px;
}

.display0 button {
    background: none;
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid #eee;
    border-radius: 18px;
    padding: 12px;
}

.display0 button:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.display0 #power-button {
    border-radius: 18px;
    background: none;
    border: none;
}

.display0 #power-button:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.display0 #power-button:active {
    background-color: rgba(255, 255, 0, 0.2);
}

.display0 #welcome-label {
    font-size: 0px;
}

.display0 #clock-label {
    font-family: monospace;
    font-size: 0px;
}

.display0 #date-label {
    font-size: 0px;
}

/* Styles for display 1 */
.display1 window {
    background-image: url("/usr/share/wallpapers/garuda-wallpapers/Black Eagle.png");
    background-size: 100% 100%;
}

.display1 #form-wrapper {
    opacity: 0;
}

.display1 entry, .display1 button {
    opacity: 0;
}

.display1 #welcome-label,
.display1 #clock-label,
.display1 #date-label,
.display1 #form-label,
.display1 #form-combo,
.display1 #password-entry,
.display1 #login-button,
.display1 #power-button {
    opacity: 0;
}

Anyway, I guess I just wanted to clarify the request in case I had been misunderstood. It is certainly not a crucial feature by any means. I just thought it would be a nice touch for multi-monitor setups.

No worries either way, thanks for your time and have a great rest of your week. :wave:

nwg-piotr commented 1 month ago

I could just create an empty window (no form, same css sheet) on excluded monitors. I'll try when I have nothing more urgent to do.

nwg-piotr commented 1 month ago

The commit above should do the job. Available for testing on the empty-window branch. Specify monitors to display the form on with the form_on_monitors value in your /etc/nwg-hello/nwg-hello.json.

nwg-piotr commented 1 month ago

Merged into main.

BluishHumility commented 1 month ago

Wow! :star_struck:

I just got a chance to test it out, it turned out great! The way you did it is exactly what I was imagining, thank you so much! :trophy:

nwg-piotr commented 1 month ago

Good that you like it. :)