Jump to content

Mojave "light mode" hybrid transparency "patch" WORKING (with proof pictures)


23 posts in this topic

Recommended Posts

Those who use Mojave with an OpenGL (non-Metal) Video Card in "dark mode" have noticed that global transparencies are working fine, while in "light mode" encountered the "grey" Finder menu bar and sidebars issues, this patch is intended for those who want to use Mojave mainly in "light mode" saving some transparencies around, so here is my "hybrid reduce transparency" patch.

 

It is totally safe, harmless and reversible, it has been deeply tested and will 100% work until restart or logout, even after sleep lock screen it will still work.
To return with normal "transparency" you can also do that from Accessibility prefpane disabling the "reduce transparency" checkbox.
To use this patch just double click on this attached shell "mojavehld.command" and it will launch through Terminal.


[METHOD 1: Enable hybrid transparency]
After launch the mojavehld.command just follow these steps:
type 1
type 4

close Terminal (CMD+Q) and any other app previously opened.

(The choice number 3 is not mandatory)

[METHOD 2: Force hybrid transparency]
If for some reason after that you will still get Dock and Notification Center without "transparencies" then relaunch the mojavehld.command:
type 2
type 1
type 4

close Terminal (CMD+Q) and any other app previously opened.

 

Download attached here: mojavehld.zip

 

desert finder menu.png

desert notification bar.png

color finder menu.png

color notification.png

color finder dock.png

Edited by jackluke
  • Like 2
  • Thanks 2

Hmm... ok, so all in all, all that your script does is apply the good old command that disables/enables transparency:

defaults write com.apple.universalaccess reduceTransparency -bool [true|false]

What's new? the partial restart of macOS functionalities?

Edited by Hervé

Mine has a totally different purpose, is needed to fix the "grey" Finder menu bar on unsupported Metal GPUs for Mojave "light mode", it enables a "partial transparency reduction" while that link you posted is an applescript for "global transparency reduction".

 

And my "patch" doesn't require any "sudo" or "System Events" permissions.

 

The "new" is that you will have an opaque Finder menu while keeping all other elements like Dock, Notification Center and some other transparencies.

 

This is needed for Mojave "non-Metal" GPUs with only OpenGL rendering, as a workaround for the "light mode".

Edited by jackluke

H,

Firstly thanks for all your effort to get Mohave goin on non metal older graphics.

 

 

But does not change anything here, screen shot attached .

But I lost trackpad control after applying this patch.

Restored back default and trackpad works again.

 

Regards

macq

 

 

Screenshot 2018-09-18 at 6.26.28 PM.png

The default write com.apple.universalaccess reduceTransparency -boot [true|false] command just does what it's always done.

 

What leads to claim there is "hybrid transparency" is that, after executing the command to disable transparency, the script only restarts Finder and Spotlight, not the Dock or anything else. However, after a reboot, transparency is completely disabled, as anyone would expect, i.e. white Finder bar, dark Dock, etc.. So the "hybrid transparency" is only effective for as long as you run the script from a system with transparency enabled and you do not reboot.

 

You need to restore default transparency settings before a reboot or shutdown if you want to enjoy the results of that script again (i.e. you need to either run the script and select option 2, or enter the default write command to set reduction to false or use the Accessibility->Display PrefPane to untick Reduce transparency parameter). All in all, it's nice for a few times but probably rapidly quite annoying to do in the long run.

 

Example on non-Metal HD3000 system in light mode...

* with default transparency:

Default_transparency.thumb.png.87c8f80cc62a00275f8751c907df1462.png

 

* without transparency:

No_transparency.thumb.png.a2f2d85ecb1867c5419601a2726d03ad.png

 

* after executing the script under default transparency mode:

After_script.thumb.png.65407238bdb2b7e4cce879d3f6cdff00.png

 

* after rebooting the system without restoring default transparency settings:

No_transparency.thumb.png.a2f2d85ecb1867c5419601a2726d03ad.png

 

So, yes, the trick with Finder brings a nicer look but you have to restore default settings to avoid total loss of transparency on reboot. This would need to be refined through an automated process at boot and restart/shutdown to be properly usable.

 

Edited by Hervé
4 hours ago, Hervé said:

No, it just does what it's always done. You just got the impression it does something else on non-Metal graphics but all it does is disable transparency like it does on any other systems.

 

Example on Metal-HD4000 system...

with transparency:With_transparency.png.675f9fcbcbfdefe6b65373ef8c6c91ed.png

 

without transparency:

 

Without_transparency.png

 

Of course HD4000 is Metal supported, you should instead try that on HD3000 that is OpenGL only (non-Metal), or any Legacy Nvidia Tesla or ATI with QE/CI.

 

Please try that on an HD3000 and you'll notice what I meant.

 

Anyway you evidenced the less important thing into your screenshot, my patch is working fine.

 

If you get offended because I called it "patch", call as you want, but I can assure that this little script does its own duty as workaround for Mojave "light mode".

You can't find a better solution till now to keep transparent Dock and at the same time a clear white opaque Finder menu bar in "light mode".

 

4 hours ago, macq said:

H,

Firstly thanks for all your effort to get Mohave goin on non metal older graphics.

 

 

But does not change anything here, screen shot attached .

But I lost trackpad control after applying this patch.

Restored back default and trackpad works again.

 

Regards

macq

 

 

Screenshot 2018-09-18 at 6.26.28 PM.png

 

Which GPU do you have ?

 

Try again these steps, launch the Terminal mojavehld.command then type followed by "enter key": 2, 1, 4

 

Probably when you lost the trackpad, if in the "meanwhile" you used an USB mouse you could notice that script was perfectly working.

Edited by jackluke
17 minutes ago, jackluke said:

 

Which GPU do you have ?

 

Try again these steps, launch the Terminal mojavehld.command then type followed by "enter key": 2, 1, 4

Hi,

 

Mine is Nvidia gt 320m.

Specs in sig.

 

Edit, with this setting loose the transparency of the dock now, but trackpad working.

Screen shot attached.

 

Screenshot 2018-09-18 at 6.58.21 PM.png

Edited by macq
45 minutes ago, macq said:

Hi,

 

Mine is Nvidia gt 320m.

Specs in sig.

 

Ok that's a legacy Nvidia Tesla so it works, but unluckily in your case probably there is conflict with your internal "trackpad", try with an USB mouse to notice that "hybrid transparency" is working.

 

45 minutes ago, macq said:

Edit, with this setting loose the transparency of the dock now, but trackpad working.

Screen shot attached.

 

Ok then go through "System Preferences - Accessibility prefpane - Display"

de-select the "reduce transparency" checkbox

Then relaunch my script and type 1, close Terminal, now it should give Dock and Notification Center transparencies and fix the greyed Finder menu.

Edited by jackluke
20 hours ago, Hervé said:

The default write com.apple.universalaccess reduceTransparency -boot [true|false] command just does what it's always done.

 

What leads to claim there is "hybrid transparency" is that, after executing the command to disable transparency, the script only restarts Finder and Spotlight, not the Dock or anything else. However, after a reboot, transparency is completely disabled, as anyone would expect, i.e. white Finder bar, dark Dock, etc.. So the "hybrid transparency" is only effective for as long as you run the script from a system with transparency enabled and you do not reboot.

 

You need to restore default transparency settings before a reboot or shutdown if you want to enjoy the results of that script again (i.e. you need to either run the script and select option 2, or enter the default write command to set reduction to false or use the Accessibility->Display PrefPane to untick Reduce transparency parameter). All in all, it's nice for a few times but probably rapidly quite annoying to do in the long run.

 

Example on non-Metal HD3000 system in light mode...

* with default transparency:

Default_transparency.thumb.png.87c8f80cc62a00275f8751c907df1462.png

 

* without transparency:

No_transparency.thumb.png.a2f2d85ecb1867c5419601a2726d03ad.png

 

* after executing the script under default transparency mode:

After_script.thumb.png.65407238bdb2b7e4cce879d3f6cdff00.png

 

* after rebooting the system without restoring default transparency settings:

No_transparency.thumb.png.a2f2d85ecb1867c5419601a2726d03ad.png

 

So, yes, the trick with Finder brings a nicer look but you have to restore default settings to avoid total loss of transparency on reboot. This would need to be refined through an automated process at boot and restart/shutdown to be properly usable.

 

 

I did already tried to create an automated process in this way:

 

creating a mojavehld.plist in /Library/LaunchDaemons/ to execute a script before shutdown and startup

 

creating a mojavehld.sh in /Library/LaunchDaemons/ to execute the script to keep the "hybrid transparency"

 

pointing the mojavehld.plist to the mojavehld.sh

 

sudo chown 0:0 /Library/LaunchDaemons/mojavehld.plist

sudo chown 0:0 /Library/LaunchDaemons/mojavehld.sh

 

sudo launchctl load -w /Library/LaunchDaemons/mojavehld.plist

 

One little issue I've encountered is that I've to consider to edit this file before the loginwindow:

~/Library/Preferences/com.apple.universalaccess.plist

 

In Mojave this is not in plaintext but binary encoded, so it will result a bit invasive for most users.

 

 

For now I believe that the script I did on the main post is a good workaround for those who want to use a temporary "light mode" until a reboot of course, and even if a bit uncomfortable, relaunching the script after a restart to me is not a drama.

 

Edited by jackluke
  • 2 weeks later...

i was encouraged and I love command line stuff - but then got less excited for the future of my HD3000 system... as this seems to (almost) do what System Preferences/Accessibility/Display "Reduce Transparency" does? I say almost as the GUI enables and updates the full gamut of objects. 

 

by the way, i wish i knew what one needs to restart via command line to get immediate effect...

 

as I was trying to figure out how to switch from Light Mode to Dark Mode via command line so I could turn it on/off via a schedule.

 

this seems to be the key item  
defaults write "Apple Global Domain" "AppleInterfaceStyle" Dark

but after Dark is set, I need to logout/login so see effect.

 

 

 

Edited by tluck
11 hours ago, tluck said:

i was encouraged and I love command line stuff - but then got less excited for the future of my HD3000 system... as this seems to (almost) do what System Preferences/Accessibility/Display "Reduce Transparency" does? I say almost as the GUI enables and updates the full gamut of objects. 

 

by the way, i wish i knew what one needs to restart via command line to get immediate effect...

 

as I was trying to figure out how to switch from Light Mode to Dark Mode via command line so I could turn it on/off via a schedule.

 

this seems to be the key item  
defaults write "Apple Global Domain" "AppleInterfaceStyle" Dark

but after Dark is set, I need to logout/login so see effect.

 

 

Yes, I have exploited the "reduce transparency" Accessibility feature discovering that doing it from Terminal until you don't relaunch Finder.app or Dock.app (I mean the CoreServices app) the GUI will keep a partial transparency, it's not a long run patch however it works and totally harmless for the system.

 

In your specific case I guess you refer to these dictionary keys:

  • Light mode: defaults delete Apple\ Global\ Domain AppleInterfaceStyle

  • Dark mode: defaults write Apple\ Global\ Domain AppleInterfaceStyle Dark

 

You can follow the method I used for create my script, to see the immediate effect without logout/login just type from Mojave Terminal:

 

defaults write com.apple.universalaccess reduceTransparency -bool false

killall Finder

killall Dock

killall NotificationCenter

killall Spotlight

 

 

While this is used only for the "light mode":

 

defaults write com.apple.universalaccess reduceTransparency -bool true

killall Finder

killall Spotlight

 

Edited by jackluke

Here is my original method "translated" into an AppleScript so anyone can put it on Automator and it will do the trick switching between a full translucent "dark mode" and a semi-translucent "light mode":

 

tell application "System Events"

tell appearance preferences

if dark mode is false then

set dark mode to true

do shell script "defaults write com.apple.universalaccess reduceTransparency -bool false"

do shell script "killall Finder"

do shell script "killall Dock"

do shell script "killall NotificationCenter"

do shell script "killall Spotlight"

else

set dark mode to false

do shell script "defaults write com.apple.universalaccess reduceTransparency -bool true"

do shell script "killall Finder"

do shell script "killall Spotlight"

end if

end tell

end tell

 

 

Here is the Applescript already-ready to download: hybrid dark light switch.zip

 

 

Edited by jackluke
  • Like 1
  • 5 weeks later...
On 10/4/2018 at 2:34 PM, jackluke said:

Here is my original method "translated" into an AppleScript so anyone can put it on Automator and it will do the trick switching between a full translucent "dark mode" and a semi-translucent "light mode":

 

tell application "System Events"

tell appearance preferences

if dark mode is false then

set dark mode to true

do shell script "defaults write com.apple.universalaccess reduceTransparency -bool false"

do shell script "killall Finder"

do shell script "killall Dock"

do shell script "killall NotificationCenter"

do shell script "killall Spotlight"

else

set dark mode to false

do shell script "defaults write com.apple.universalaccess reduceTransparency -bool true"

do shell script "killall Finder"

do shell script "killall Spotlight"

end if

end tell

end tell

 

 

Here is the Applescript already-ready to download: hybrid dark light switch.zip

Great work mate. Can you explain what I must do with Automator because I am a beginner with that staff. Thanks!

The script doesn't seem to work correctly. We want it to run the code when we press light mode and do nothing when we press dark mode. How do we do that?

 

Quote

 

Edited by belodelo

Try the app I posted here. It's based on Jackluke's work and only applies to Light mode. It does nothing in Dark mode. It's created in Automator from the provided script. But maybe you don't know how to use the tool...

Edited by Hervé
  • 1 month later...

Mine has a totally different purpose, is needed to fix the "grey" Finder menu bar on unsupported Metal GPUs for Mojave "light mode", it enables a "partial transparency reduction" while that link you posted is an applescript for "global transparency reduction".

I believe you're mistaken and must have missed something, especially as I explained what every line of the script did. You may also refer to Jackluke's explanations above.

 

Of course, if you want to compare things and/or enlighten us, well... show us yours!

  • 2 weeks later...
  • 3 months later...

I don't know if anybody else has come across the issue, however upon installing this patch some third party applications such as Chrome made the menubar go back to it's broken state. I found out that it was because Chrome was still seeing the system as being in dark mode, and had adjusted its interface accordingly. To fix this, I wrote a small applescript program to force applications like chrome to act as they would in light theme.

 

Fix Dark Menubar in Third Party Apps.app.zip

Edited by Doofitator
Bugfix
7 hours ago, Doofitator said:

I don't know if anybody else has come across the issue, however upon installing this patch some third party applications such   Audacity Find My iPhone Origin         as Chrome made the menubar go back to it's broken state. I found out that it was because Chrome was still seeing the system as being in dark mode, and had adjusted its interface accordingly. To fix this, I wrote a small applescript program to force applications like chrome to act as they would in light theme.

 

Fix Dark Menubar in Third Party Apps.app.zip

transparency is completely disabled, as anyone would expect, i.e. white Finder bar, dark Dock, etc.. So the "hybrid transparency" is only effective for as long as you run the script from a system with transparency enabled and you do not reboot.

  • 3 weeks later...

I added some lines for automatic settings when switching between light/dark mode and different machines.

 

set MacModel to (do shell script "system_profiler SPHardwareDataType | awk '/Model Identifier/ {print $3}'")

if MacModel is not "MacBookAir5,2" and MacModel is not "MacPro6,1" then --is the script run on a specific Mojave-supported machine?

  tell application "System Events"

    tell appearance preferences

      set reduceTransparency to get do shell script "defaults read com.apple.universalaccess reduceTransparency -bool"

      if dark mode is false then -- light mode is active

        if reduceTransparency is "1" then -- reduceTransparency was active

          do shell script "defaults write com.apple.universalaccess reduceTransparency -bool false"

          do shell script "killall Dock"

          do shell script "killall NotificationCenter"

          delay 1

          do shell script "defaults write com.apple.universalaccess reduceTransparency -bool true"

          do shell script "killall Finder"

          do shell script "killall Spotlight"

        else -- reduceTransparency was off

          do shell script "defaults write com.apple.universalaccess reduceTransparency -bool true"

          do shell script "killall Finder"

          do shell script "killall Spotlight"

          display dialog "Please reboot manually to disable menu bar transparency." giving up after 5

        end if

      else -- dark mode is active

        if reduceTransparency is "1" then -- reduceTransparency was active

          do shell script "defaults write com.apple.universalaccess reduceTransparency -bool false"

          do shell script "killall Finder"

          do shell script "killall Dock"

          do shell script "killall NotificationCenter"

          do shell script "killall Spotlight"

          display dialog "Please reboot manually to enable menu bar transparency." giving up after 5

        end if

      end if

    end tell

  end tell

end if

Edited by alrunenwurzel
Format
  • 1 month later...
On 5/6/2019 at 9:21 AM, alrunenwurzel said:

I added some lines for automatic settings when switching between light/dark mode and different machines.

 

set MacModel to (do shell script "system_profiler SPHardwareDataType | awk '/Model Identifier/ {print $3}'")

if MacModel is not "MacBookAir5,2" and MacModel is not "MacPro6,1" then --is the script run on a specific Mojave-supported machine?

  tell application "System Events"

    tell appearance preferences

      set reduceTransparency to get do shell script "defaults read com.apple.universalaccess reduceTransparency -bool"

      if dark mode is false then -- light mode is active

        if reduceTransparency is "1" then -- reduceTransparency was active

          do shell script "defaults write com.apple.universalaccess reduceTransparency -bool false"

          do shell script "killall Dock"

          do shell script "killall NotificationCenter"

          delay 1

          do shell script "defaults write com.apple.universalaccess reduceTransparency -bool true"

          do shell script "killall Finder"

          do shell script "killall Spotlight"

        else -- reduceTransparency was off

          do shell script "defaults write com.apple.universalaccess reduceTransparency -bool true"

          do shell script "killall Finder"

          do shell script "killall Spotlight"

          display dialog "Please reboot manually to disable menu bar transparency." giving up after 5

        end if

      else -- dark mode is active

        if reduceTransparency is "1" then -- reduceTransparency was active

          do shell script "defaults write com.apple.universalaccess reduceTransparency -bool false"

          do shell script "killall Finder"

          do shell script "killall Dock"

          do shell script "killall NotificationCenter"

          do shell script "killall Spotlight"

          display dialog "Please reboot manually to enable menu bar transparency." giving up after 5

        end if

      end if

    end tell

  end tell

end if

 This is perfect! While I did plan to make a slight change, I am more interested in tying this into the "Light Mode / Dark Mode Preference Panes" using this script as a event trigger as apposed to using this as a Login Item (check box Hidden). I'll see what I can do today. 

×
×
  • Create New...