Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We’re making changes to the Unity Runtime Fee pricing policy that we announced on September 12th. Access our latest thread for more information!
    Dismiss Notice
  3. Dismiss Notice

Auto Dark Theme [Open Source]

Discussion in 'Assets and Asset Store' started by biosmanager, Oct 9, 2020.

  1. biosmanager

    biosmanager

    Joined:
    May 10, 2017
    Posts:
    9
    I like switching between light and dark themes based on the time of day/system theme and because Unity lacks that functionality I implemented it myself:

    Auto Dark Theme

    Automatically sets the Unity editor theme based on the current time or system theme settings.

    Supported operating systems for system-based switching:
    • Windows 10 Version 1903 and later
    • macOS Mojave (10.14.0) and later

    preview.png

    Download: https://assetstore.unity.com/packages/slug/180747
    Source: https://github.com/biosmanager/AutoDarkTheme
     
    Last edited: Oct 22, 2020
    kfireven likes this.
  2. biosmanager

    biosmanager

    Joined:
    May 10, 2017
    Posts:
    9
    Update 1.2.0

    Added macOS support and time-based theme switching.
     
  3. biosmanager

    biosmanager

    Joined:
    May 10, 2017
    Posts:
    9
  4. APSchmidt

    APSchmidt

    Joined:
    Aug 8, 2016
    Posts:
    4,376
    Do you really need to access the registry to do that? Isn't there another way? Also, I guess there won't be a Linux version?
     
  5. biosmanager

    biosmanager

    Joined:
    May 10, 2017
    Posts:
    9
    Observing the registry seemed like the most straight-forward way. What are your concerns with this method? I'm only reading, not writing.
    I suspect calling WinRT via P/Invoke does not work because Unity Editor is not UWP.
    But maybe there is indeed a better method.

    You should be able to use time-based switching on Linux, although I didn't test this yet.
    To my knowledge there is no unified way to detect system light/dark themes on all various desktop environments.
     
    Last edited: Oct 22, 2020