Dark Style Preference

CharDSonCharDSon
Community Member

GNOME, KDE Plasma and Elementary OS include a way for apps to switch between light and dark themes. It would be a good idea for 1Password to follow this implementation to have better consistency between different desktop environments.

Useful documentation:
https://gitlab.gnome.org/GNOME/Initiatives/-/wikis/Dark-Style-Preference
https://blogs.gnome.org/alexm/2021/10/04/dark-style-preference/


1Password Version: Not Provided
Extension Version: Not Provided
OS Version: Fedora 35 Workstation

Comments

  • SavanniSavanni

    Team Member

    @CharDSon Are you seeing problems with this right now, or are you anticipating problems from the update to Gnome 42?

    I'll confess that I only a week or two ago got updated to Gnome 41, so I'm not even yet paying attention to Gnome 42.

  • owendaprileowendaprile
    Community Member

    I'm on the Fedora 36 Beta (with GNOME 42), and while there aren't really any issues, the experience could be better. The settings app now includes a light/dark theme chooser, and 1Password doesn't follow this when its theme is set to match system. Moreover, choosing a dark theme in settings and a dark theme in 1Password gives 1Password a light header bar, which looks out of place. I think the new color scheme preference should be used over checking the GTK theme (or however 1Password does it now), when it is available.

  • PeterG_1PPeterG_1P

    Team Member

    Hi @owendaprile, thanks for letting us know about this. Can you tell me what your installation method for 1Password was on this device (package manager, tar, flatpak, etc.)? This might be relevant. I'll be happy to follow up on the issue for you!

  • owendaprileowendaprile
    Community Member

    @PeterG_1P

    I'm using the 1Password package for Fedora (1password-8.6.1-1.x86_64). When using the new freedesktop settings portal, it shouldn't matter how it's installed (as long as the Flatpak can talk to the settings portal over D-Bus).

  • SavanniSavanni

    Team Member

    Currently we use Electron's default mechanism for checking system settings. I like that Gnome is going to put this in DBus. That's a really good home for such information and is relatively easy to query. It might get little bit tricky in our code where we would need to step in before Electron does. I'll make an issue for this and we will see what we can do about it. I'll also see if I can get upgraded to Gnome 42, but that might not be available to me for a bit longer.

  • mrochemroche
    Community Member
    edited June 28

    I would also like to voice my support for this, though I understand it will be better to come from the Electron camp than 1Password. A number of apps I use don't follow the new color scheme directive and they're all Electron, but they do respect the GTK theme.

    I currently use a custom script to alter the GTK theme based on which color-scheme is selected in GNOME, however there is a catch with 1Password where the Quick Access overlay doesn't fully transition over and the UI will appear washed out. Restarting 1Password solves the problem for the time being.

    #!/bin/bash
    
    current=$(gsettings get org.gnome.desktop.interface color-scheme)
    
    # In GNOME, the dark hint is set to 'prefer-dark', and the
    # light hint to 'default' (can optionally be 'prefer-light').
    if [ $current = "'prefer-dark'" ]
    then
        gsettings set org.gnome.desktop.interface gtk-theme 'Adwaita-dark'
    else
        gsettings set org.gnome.desktop.interface gtk-theme ''
    fi
    

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Image
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file