greetd: add option to set CSS file for GTK based greeters

Add key to set gtkgreet's style.css in config

Change logic, add comment for setting style.css path

Fix adding style.css path

deduplicate logic

Fix typo

Change config description

Formatting fixes
This commit is contained in:
Sunderland93 2023-02-28 22:41:52 +04:00
parent ce9250acb5
commit 7da1b1eb32
3 changed files with 7 additions and 0 deletions

View File

@ -65,11 +65,14 @@ sysconfigSetup: false
# greetd has configurable user and group; the user and group is created if it
# does not exist, and the user is set as default-session user.
#
# Some greeters for greetd (e.g gtkgreet or regreet) have support for a user's GTK CSS style to change appearance.
#
# lightdm has a list of greeters to look for, preferring them in order if
# they are installed (if not, picks the alphabetically first greeter that is installed).
#
greetd:
greeter_user: "tom_bombadil"
greeter_group: "wheel"
greeter_css_location: "/etc/greetd/style.css"
lightdm:
preferred_greeters: ["lightdm-greeter.desktop", "slick-greeter.desktop"]

View File

@ -25,6 +25,7 @@ properties:
properties:
greeter_user: { type: string }
greeter_group: { type: string }
greeter_css_location: { type: string }
additionalProperties: false
lightdm:
type: object

View File

@ -782,6 +782,7 @@ class DMgreetd(DisplayManager):
executable = "greetd"
greeter_user = "greeter"
greeter_group = "greetd"
greeter_css_location = None
config_data = {}
def os_path(self, path):
@ -849,6 +850,8 @@ class DMgreetd(DisplayManager):
de_command = default_desktop_environment.executable
if os.path.exists(self.os_path("usr/bin/gtkgreet")) and os.path.exists(self.os_path("usr/bin/cage")):
self.config_data['default_session']['command'] = "cage -d -s -- gtkgreet"
if self.greeter_css_location:
self.config_data['default_session']['command'] += f" -s {self.greeter_css_location}"
elif os.path.exists(self.os_path("usr/bin/tuigreet")):
tuigreet_base_cmd = "tuigreet --remember --time --issue --asterisks --cmd "
self.config_data['default_session']['command'] = tuigreet_base_cmd + de_command