Auto-Disable Hot Corners When Playing GeForce NOW on macOS
One of the small but constant annoyances I’ve had with GeForce NOW on macOS is accidentally triggering Hot Corners mid-game. You know the move — flick your mouse a bit too far, and suddenly Mission Control or the Desktop pops up, breaking the flow.
macOS doesn’t give you a built-in way to automatically turn Hot Corners off in Game Mode or when a specific app is running. So I solved it with a little automation using Hammerspoon.
The logic is simple:
- If GeForce NOW is running → save your current Hot Corner setup and set all corners to None.
- If it’s not running → restore your previous settings exactly as they were.
It works instantly when launching or quitting GeForce NOW, so you never have to remember to toggle anything.
Here’s the hammerspoon init script (just drop it into ~/.hammerspoon/init.lua and reload). It’s lightweight, fast, and fixes one of my long-standing gaming headaches on macOS.
-- Auto-disable Hot Corners while GeForce NOW is running
-- Works across Hammerspoon versions (no :isRunning), prefers bundle IDs.
-- ===== Config =====
local DOCK_DOMAIN = "com.apple.dock"
local CORNERS = { "tl", "tr", "bl", "br" }
local SETTINGS_KEY = "savedHotCornersBeforeGFN"
local TARGET_BUNDLE_IDS = {
["com.nvidia.geforcenow"] = true,
["com.nvidia.gfnpc.mall"] = true,
}
local TARGET_NAMES = {
["GeForce NOW"] = true,
["NVIDIA GeForce NOW"] = true,
}
-- ===== Helpers =====
local function sh(cmd)
-- hs.execute returns: outputString, successBool, typeString, exitCode
local out, ok, _, rc = hs.execute(cmd, true)
return ok, out or "", rc or 0
end
local function readCorners()
local cur = {}
for _, c in ipairs(CORNERS) do
local cornerKey = ("wvous-%s-corner"):format(c)
local modKey = ("wvous-%s-modifier"):format(c)
local _, cornerOut = sh(('/usr/bin/defaults read %s %s 2>/dev/null'):format(DOCK_DOMAIN, cornerKey))
local _, modOut = sh(('/usr/bin/defaults read %s %s 2>/dev/null'):format(DOCK_DOMAIN, modKey))
cur[c] = {
corner = tonumber((cornerOut or ""):match("(%d+)")) or 0,
modifier = tonumber((modOut or ""):match("(%d+)")) or 0,
}
end
return cur
end
local function applyCorners(cfg)
for _, c in ipairs(CORNERS) do
local v = cfg[c] or { corner = 0, modifier = 0 }
sh(('/usr/bin/defaults write %s %s -int %d'):format(DOCK_DOMAIN, ("wvous-%s-corner"):format(c), v.corner))
sh(('/usr/bin/defaults write %s %s -int %d'):format(DOCK_DOMAIN, ("wvous-%s-modifier"):format(c), v.modifier))
end
sh('/usr/bin/killall Dock') -- reload Dock
end
-- ===== Core actions =====
local function disableCorners()
if hs.settings.get(SETTINGS_KEY) == nil then
hs.settings.set(SETTINGS_KEY, readCorners())
end
local none = {}
for _, c in ipairs(CORNERS) do
none[c] = { corner = 0, modifier = 0 }
end
applyCorners(none)
end
local function restoreCorners()
local saved = hs.settings.get(SETTINGS_KEY)
if saved then
applyCorners(saved)
hs.settings.clear(SETTINGS_KEY)
end
end
-- ===== App detection =====
local function isGFNRunning()
-- Prefer bundle IDs (reliable)
for bid, _ in pairs(TARGET_BUNDLE_IDS) do
if hs.application.get(bid) then return true end
end
-- Fallback to names (if needed)
for name, _ in pairs(TARGET_NAMES) do
if hs.application.get(name) then return true end
end
return false
end
-- ===== Watcher =====
local appWatcher = hs.application.watcher.new(function(appName, event, app)
local isGFN = false
if app then
local bid = app:bundleID()
if bid and TARGET_BUNDLE_IDS[bid] then isGFN = true end
end
if not isGFN and appName and TARGET_NAMES[appName] then
isGFN = true
end
if not isGFN then return end
if event == hs.application.watcher.launched then
disableCorners()
elseif event == hs.application.watcher.terminated then
restoreCorners()
end
end)
-- ===== Safety on Hammerspoon quit/reload =====
hs.shutdownCallback = function()
if not isGFNRunning() then
restoreCorners()
end
end
-- ===== Boot =====
appWatcher:start()
if isGFNRunning() then
disableCorners()
else
restoreCorners()
end
hs.alert.show("GFN Hot Corners auto-toggle active")
I think this is a neat little quality-of-life tweak — nothing earth-shattering, but one of those changes that makes the whole setup feel smoother.