zenangst/Gray

Not Working / Saving Settings

brycejacobson opened this issue · 10 comments

Hi, Thanks for this! This is exactly what I'm looking for.

I'm having the same issues for Mail.app #7 and actually its not working for any application for that matter.

I've restarted, and logged in/out and also tried running the following with no luck.

/usr/bin/killall -u $USER cfprefsd
defaults write com.apple.mail NSRequiresAquaSystemAppearance -bool true

I'm also seeing Gray not save the appearance setting for some apps. Setting Messages.app to light mode, quit Gray and reopen Gray. Messages is set back to "System appearance".

Also some apps like Messages isn't allowing me to toggle between Light/Dark in Gray. Mail seems to work here while Messages gets stuck in "Light appearance".

I look forward to updates and can run some tests if you need.

@drivenfaroff hey mate, trying to get to the bottom of this issue and I've been tinkering with some enhancements in this PR #27 but I'm still unsure if it fixes it for everyone. The app that has been misbehaving for me is Contacts. Mail and Messages have been working fine with my testing.

I'll post an update here when I have something more to test. Sorry for any inconvenience.

@drivenfaroff version 0.5.0 is out which has some slight changes to how it writes new preferences to plists. The details are in the PR - https://github.com/zenangst/Gray/pull/27/files

Mind taking the new version out for a spin? -
https://github.com/zenangst/Gray/releases/download/0.5.0/Gray.zip

I just found a small clue that might be the culprit in this drama, so I made a new version: https://github.com/zenangst/Gray/releases/download/0.5.1/Gray.zip

Another day, another version. Hoping that this version works better - https://github.com/zenangst/Gray/releases/download/0.5.2/Gray.zip

@zenangst Things are working a lot better! Thanks for the updates.

Settings for each app seem to be saving correctly and apps are quitting and re-opening fine when switching settings.

It's also changing almost every app correctly except for Mail.app still. Mail will quit but won't restart. Then it won't change the color, it's stuck on whatever system prefs are set to.

@drivenfaroff Glad to hear that we heading in the right direction. I'm starting to wonder if this is an environmental problem that I'm having issues recreating.

What if we take the application out of the equation for a bit and try to get it working with terminal commands.

Turn on Dark appearance

killall -9 Mail
/usr/bin/killall -u $USER cfprefsd
defaults write com.apple.mail NSRequiresAquaSystemAppearance -bool false
defaults read com.apple.mail NSRequiresAquaSystemAppearance
open /Applications/Mail.app

Turn on Light appearance

killall -9 Mail
/usr/bin/killall -u $USER cfprefsd
defaults write com.apple.mail NSRequiresAquaSystemAppearance -bool true
defaults read com.apple.mail NSRequiresAquaSystemAppearance
open /Applications/Mail.app

What happens if you run these commands in sequence in your terminal, you should be able to just copy paste them.

They will do the following:

  1. Kill the Mail application
  2. Kill the preferences service for your user
  3. Write a new setting to Mail's plist (its bundle identifier is com.apple.mail).
  4. Read the preference to refresh the plist cache.
  5. Open Mail

Also, with the latest version of the app, Gray should print messages to the system console. You should be able to obtain which commands it runs and the output it gets back from the shell scripts using the Console.app. If you could paste those here that would be fantastic.

Cheers!

Hey @drivenfaroff, would you mind trying this version Gray 0.7.1.zip ?

Hi @zenangst. I Tried the commands in the terminal with no luck. I also tried .7.1 with no luck on Mail.app. Here is some of the output from console.app.

default	08:36:27.987616 -0500	Gray	New settings for Mail = true
default	08:36:27.987722 -0500	Gray	command: /usr/bin/killall -u $USER cfprefsd
/usr/libexec/PlistBuddy -c "Set :NSRequiresAquaSystemAppearance true" /Users/brycejacobson/Library/Preferences/com.apple.mail.plist
defaults read com.apple.mail NSRequiresAquaSystemAppearance /Users/brycejacobson/Library/Preferences/com.apple.mail.plist
default	08:36:28.081088 -0500	Gray	output: (1
)
default	08:36:55.634819 -0500	Gray	27366555: RECEIVED OUT-OF-SEQUENCE NOTIFICATION: 190 vs 286, 512, <private>
default	08:37:07.594515 -0500	Gray	New settings for Mail = false
default	08:37:07.594576 -0500	Gray	command: /usr/bin/killall -u $USER cfprefsd
/usr/libexec/PlistBuddy -c "Set :NSRequiresAquaSystemAppearance false" /Users/brycejacobson/Library/Preferences/com.apple.mail.plist
defaults read com.apple.mail NSRequiresAquaSystemAppearance /Users/brycejacobson/Library/Preferences/com.apple.mail.plist
default	08:37:07.943930 -0500	Gray	output: (0
)
default	08:37:17.338609 -0500	Gray	New settings for Mail = true
default	08:37:17.338676 -0500	Gray	command: /usr/bin/killall -u $USER cfprefsd
/usr/libexec/PlistBuddy -c "Set :NSRequiresAquaSystemAppearance true" /Users/brycejacobson/Library/Preferences/com.apple.mail.plist
defaults read com.apple.mail NSRequiresAquaSystemAppearance /Users/brycejacobson/Library/Preferences/com.apple.mail.plist
default	08:37:17.427256 -0500	Gray	output: ()
default	08:37:25.319548 -0500	Gray	New settings for Mail = false
default	08:37:25.319603 -0500	Gray	command: /usr/bin/killall -u $USER cfprefsd
/usr/libexec/PlistBuddy -c "Set :NSRequiresAquaSystemAppearance false" /Users/brycejacobson/Library/Preferences/com.apple.mail.plist
defaults read com.apple.mail NSRequiresAquaSystemAppearance /Users/brycejacobson/Library/Preferences/com.apple.mail.plist
default	08:37:29.426191 -0500	Gray	output: (0
)
default	08:37:52.643683 -0500	Gray	New settings for Mail = false
default	08:37:52.643739 -0500	Gray	command: /usr/bin/killall -u $USER cfprefsd
/usr/libexec/PlistBuddy -c "Set :NSRequiresAquaSystemAppearance false" /Users/brycejacobson/Library/Preferences/com.apple.mail.plist
defaults read com.apple.mail NSRequiresAquaSystemAppearance /Users/brycejacobson/Library/Preferences/com.apple.mail.plist
default	08:37:52.733669 -0500	Gray	output: ()
default	08:38:01.506951 -0500	Gray	New settings for Mail = true
default	08:38:01.507006 -0500	Gray	command: /usr/bin/killall -u $USER cfprefsd
/usr/libexec/PlistBuddy -c "Set :NSRequiresAquaSystemAppearance true" /Users/brycejacobson/Library/Preferences/com.apple.mail.plist
defaults read com.apple.mail NSRequiresAquaSystemAppearance /Users/brycejacobson/Library/Preferences/com.apple.mail.plist
default	08:38:04.606839 -0500	Gray	output: (1
)

@drivenfaroff I did some deep-diving into the sandbox and it seems like it was SIP throwing me for a loop.

I found a way to solve it, you need to grant the app full privileges, otherwise, it cannot configure apps like mail. You do that by adding it to Preferences > Security & Privacy > Full Disk Access.

screen shot 2018-10-08 at 19 15 14

You can read my summary on this issue here -
#7 (comment)

Hope this helps and puts a nail in the coffin on this bug, cheers :)

That worked! Awesome! Thanks for helping figure this out. I'll close this now as things seem to be pretty stable!

I look forward to following the continued process.