Compare commits
2 Commits
a68069afaa
...
6a0a954e7e
| Author | SHA1 | Date | |
|---|---|---|---|
| 6a0a954e7e | |||
| d4ff06d1a3 |
@@ -0,0 +1,38 @@
|
|||||||
|
-- FocusMode.lua
|
||||||
|
|
||||||
|
local obj = {}
|
||||||
|
obj.isActive = false
|
||||||
|
|
||||||
|
-- Load the native C-optimized window highlighting extension
|
||||||
|
local hl = require("hs.window.highlight")
|
||||||
|
|
||||||
|
-- Configure the native isolation overlay properties
|
||||||
|
-- 78% black mask for deep workspace distraction isolation
|
||||||
|
hl.ui.isolateColor = {0, 0, 0, 0.78}
|
||||||
|
|
||||||
|
-- Start the background layout tracking engine loop natively
|
||||||
|
hl.start()
|
||||||
|
|
||||||
|
function obj.toggle()
|
||||||
|
-- Native switch to toggle isolate highlight state instantly
|
||||||
|
hl.toggleIsolate()
|
||||||
|
|
||||||
|
obj.isActive = not obj.isActive
|
||||||
|
if obj.isActive then
|
||||||
|
hs.alert.show("Focus Mode Active", 1.5)
|
||||||
|
else
|
||||||
|
hs.alert.show("Focus Mode Disabled", 1.5)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Native Hotkey Binding (Maps to your global hyper + F layout configuration)
|
||||||
|
if hyper then
|
||||||
|
hs.hotkey.bind(hyper, "F", function()
|
||||||
|
obj.toggle()
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Export module instance globally for our external Raycast script runner triggers
|
||||||
|
FocusMode = obj
|
||||||
|
|
||||||
|
return obj
|
||||||
@@ -20,8 +20,9 @@ require('AppBorders')
|
|||||||
-- CRITICAL FOR RAYCAST INTERACTION: Bind the return value to a global variable
|
-- CRITICAL FOR RAYCAST INTERACTION: Bind the return value to a global variable
|
||||||
LayoutSelector = require('LayoutSelector')
|
LayoutSelector = require('LayoutSelector')
|
||||||
|
|
||||||
require('System_Tweaks') -- Used for Time Machine Throttle Disable
|
-- require('System_Tweaks') -- Used for Time Machine Throttle Disable
|
||||||
-- require("Focus") -- Does not work with layout saver - Not needed if using Monocle
|
-- require("Focus") -- Does not work with layout saver - Not needed if using Monocle
|
||||||
|
require("FocusMode")
|
||||||
Network = require("NetworkCenter")
|
Network = require("NetworkCenter")
|
||||||
|
|
||||||
-- Load the window management module
|
-- Load the window management module
|
||||||
|
|||||||
Reference in New Issue
Block a user