NoiSek / Aether

A sleek ArchLinux login manager for lightdm-webkit. ( lightdm-webkit-theme-aether )
https://noisek.github.io/Aether/
GNU General Public License v2.0
799 stars 43 forks source link

Optionally use config file instead of localStorage values #49

Open kvnbias opened 5 years ago

kvnbias commented 5 years ago

Features

Pull request: #48

Why? QOL for users who seldom change themes using the cli. Just like GTK apps, the theme will change instantly when the config file is updated. The config will be /etc/lightdm/lightdm-webkit2-greeter.conf. Sample config file:


[greeter]
debug_mode          = false
detect_theme_errors = true
screensaver_timeout = 300
secure_mode         = true
time_format         = LT
time_language       = auto
webkit_theme        = lightdm-webkit-theme-aether

[branding]
background_images = /usr/share/pixmaps/backgrounds/
logo              = /usr/share/pixmaps/archlinux-logo.svg
user_image        = /usr/share/pixmaps/archlinux-user.svg

[aether]
wallpaper                             = nier-2b-circle.jpg
distro                                = /usr/share/lightdm-webkit/themes/lightdm-webkit-theme-aether/src/img/logos/archlinux.png
default_user                          = kev
page_zoom                             = 1.0
avatar_enabled                        = true
avatar_size                           = 200px
avatar_shape                          = circle
font_scale                            = 1.0
date_enabled                          = true
date_format                           = <em>%A</em>, the <em>%o</em> of <em>%B</em>
experimental_stars_enabled            = false
time_enabled                          = true
time_format                           = %H:%M
hostname_enabled                      = true
user_switcher_enabled                 = true
command_shutdown_enabled              = true
command_reboot_enabled                = true
command_hibernate_enabled             = true
command_sleep_enabled                 = true
style_command_logo_desaturate         = false
style_command_logo_brightness         = 100
style_command_icons_enabled           = true
style_command_text_align              = left
style_command_background_color        = #050d10dd
style_command_icon_color              = #e44742
style_command_text_color              = #e44742
style_login_border_color              = #ffffff
style_login_border_enabled            = false
style_login_button_color              = #ffffff
style_login_button_text_color         = #e44742
style_login_gradient_top_color        = #050d10dd
style_login_gradient_bottom_color     = #050d10dd
style_login_username_bold             = true
style_login_username_capitalization   = default
style_login_username_color            = #ffffff
style_login_username_italic           = true
window_border_radius                  = 4px
window_font_size                      = 1em
kvnbias commented 5 years ago

@NoiSek

How does a user export config values from the theme to a greeter-config friendly format?

As of now, according to the API (Warning SSL in the website is expired) there is currently no way to write on external files.

When a setting is changed while an external config is active, what is the expected result?

As of now, the changes will persist on the localStorage, config file will be untouched due to API's limitations, requiring the user to uncheck the Use .conf setting. Leaving the Use .conf setting checked won't show the changes next login unless the setting is turned off.

When the external config is active, should settings be disabled entirely?

This can be a nice feature to add.

When the user attempts to edit the external config, should an error be surfaced to the user?

While the config can be confusing since a normal linux user may not know the settings will be injected as a CSS value, it will take time to create a parser and it will be useless since if lightdm-webkit see's an error, lightdm-webkit will just prompt to use their default theme(antergos) instead.

Given that the relationship is one-way (read only), should it be expected that once you enable the external config you always use the external config? Having config values fall through to whatever their current localStorage value is does not seem like desired behavior or good UX.

Once the conf setting is enabled, the external config is always used. However if the user doesn't know a certain setting can be placed in the config, I prefer to show the default/localStorage value than using uncustomizeable values. But I do agree that current behavior is undesired. A solution can be: Disable all settings if external settings is checked, But leave the setting customizable if it doesn't exists in the config file