Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not Working / Saving Settings #26

Closed
brycejacobson opened this issue Oct 4, 2018 · 10 comments
Closed

Not Working / Saving Settings #26

brycejacobson opened this issue Oct 4, 2018 · 10 comments

Comments

@brycejacobson
Copy link

brycejacobson commented Oct 4, 2018

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.

@zenangst
Copy link
Owner

zenangst commented Oct 4, 2018

@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.

@zenangst
Copy link
Owner

zenangst commented Oct 5, 2018

@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

@zenangst
Copy link
Owner

zenangst commented Oct 5, 2018

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

@zenangst
Copy link
Owner

zenangst commented Oct 5, 2018

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

@brycejacobson
Copy link
Author

@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.

@zenangst
Copy link
Owner

zenangst commented Oct 6, 2018

@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!

@zenangst
Copy link
Owner

zenangst commented Oct 7, 2018

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

@brycejacobson
Copy link
Author

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
)

@zenangst
Copy link
Owner

zenangst commented Oct 8, 2018

@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 :)

@brycejacobson
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants