Skip to content

Instantly share code, notes, and snippets.

@SebastianGrans
Last active February 17, 2022 15:18
Show Gist options
  • Save SebastianGrans/ecad362ce59d80ff1565e3d6db07de8e to your computer and use it in GitHub Desktop.
Save SebastianGrans/ecad362ce59d80ff1565e3d6db07de8e to your computer and use it in GitHub Desktop.
Fix green tint when watching videos in fullscreen on MacOS

EDIT: Ignore this. It doesn't seem to work all the time anyway. Disable hardware acceleration in chrome instead.

TL;DR: If your screen gets a green tint when playing full screen videos. Resetting the mouse cursor size to 1 fixes it. The script below does that automatically for you.

When I play videos in fullscreen, I get some strange strange green tint over the video. A quick googling told me that simply resetting the cursor size to it's standard size should fix this. link

This does indeed work, even though my cursor size is always the default. But it only works temporarily...

Digging into the accessibility menu every time it happens is annoying, so I needed a script of some form. Thankfully the Stackoverflow user @Jw C showed me how its done! link

You can either save this file somewhere and make it executable (chmod +x fix_green_tint.js), or you can copy the body of the function directly into a Run JavaScript block in an Automator app.

This can then easily be executed using Spotlight, making the fix very easy to perform!

#!/usr/bin/osascript
function fn() {
const isRunningSystemPreferences = Application('System Preferences').running()
Application('System Preferences').panes.byId('com.apple.preference.universalaccess').anchors.byName('Seeing_Cursor').reveal()
const process = Application('System Events').processes.byName('System Preferences')
while (process.windows.length == 0) {}
const window = process.windows[0]
while (window.groups.length == 0) {}
const group = window.groups[0]
while (group.tabGroups.length == 0) {}
const tabGroup = group.tabGroups[0]
while (tabGroup.sliders.length == 0) {}
const slider = tabGroup.sliders[0]
slider.value = 1
if (!isRunningSystemPreferences) {
Application('System Preferences').quit()
}
}
fn()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment