Menu

MacOS Dark Mode

Help
1 day ago
1 day ago
  • Fred Leonard

    Fred Leonard - 1 day ago

    Weird that it works fine in Linux in Dark Mode, and not Mac, but I fixed that.

    Use this for the installer and launcher, and it will come up in Dark Mode.
    I only tested on MacOS Sequoia.

    #!/usr/bin/env bash
    
    # --- High-Speed Grsync macOS Launcher ---
    
    # 1. Fast Path Check (Skip Brew lag)
    # We check for the actual binaries instead of asking Brew
    if [[ ! -f "/usr/local/bin/grsync" || ! -f "/usr/local/bin/gdk-pixbuf-query-loaders" ]]; then
        echo "Dependencies missing. Running slow check/install..."
        brew install grsync librsvg adwaita-icon-theme
    fi
    
    # 2. Fast Cache Check
    # Only update the cache if it doesn't exist or if you just installed things
    # The cache file location for Homebrew Intel is usually here:
    CACHE_FILE="/usr/local/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache"
    if [[ ! -f "$CACHE_FILE" ]]; then
        echo "Updating icon cache..."
        /usr/local/bin/gdk-pixbuf-query-loaders --update-cache > /dev/null 2>&1
    fi
    
    # 3. Fire and Forget
    # Using 'env' to keep it clean and 'disown' to release terminal immediately
    echo "Launching Grsync..."
    nohup env GTK_THEME=Adwaita:dark /usr/local/bin/grsync >/dev/null 2>&1 & 
    disown
    
    # Final exit to close the script execution instantly
    exit
    
    # if the above doesn't bribng it up in Dark Mode, try this methjod:
    # export GTK_THEME=Adwaita:dark
    # /usr/local/bin/grsync &
    
     
  • Piero Orsoni

    Piero Orsoni - 1 day ago

    Thanks for your contribution Fred!

     
    😄
    1

Log in to post a comment.

MongoDB Logo MongoDB