mr-pennyworth / alfred-extra-pane

Rich previews for Alfred script filters
130 stars 5 forks source link

Not change to dark mode even after restart #21

Closed olivergiangvu closed 4 weeks ago

olivergiangvu commented 3 months ago

Hi,

The Extra Panel not change to dark/light mode when the system changed.

Restart the app not help only when quit and reopen work.

I noticed it start from sometimes on 0.2.3 updated until now.

mr-pennyworth commented 3 months ago

Good catch @olivergiangvu! This happens if you use Alfred on more than one machine, and AlfredExtraPane.app is launched directly (as opposed to from a workflow script filter). Alfred stores the theme info inside a "local preferences folder" (this allows most of your settings and workflows to be synced, and still use different themes on different machines). The only way to correctly find this folder is using the alfred_preferences_localhash environment variable, which is available to programs only if they are started from within a workflow script.

To get around this, launch the extra pane from your workflow script using open -g /Applications/AlfredExtraPane.app

https://github.com/mr-pennyworth/AlfredSwift/blob/23f45136fefbb398c78bd36dd6949214fcbafb4b/Sources/Alfred/Alfred.swift#L38

mr-pennyworth commented 3 months ago

Andrew has included the localhash in the next build: https://www.alfredforum.com/topic/22157-any-way-to-get-alfred_preferences_localhash-without-running-a-workflow-script/?do=findComment&comment=115359

🎉🎉

olivergiangvu commented 3 months ago

Thanks @mr-pennyworth for your great work as always. Let's wait for the new Alfred build!