Compare commits

...

2 Commits

Author SHA1 Message Date
francop 6a0a954e7e Initial Version 2026-05-16 01:21:57 -04:00
francop d4ff06d1a3 Added require("FocusMode") 2026-05-16 01:21:39 -04:00
2 changed files with 40 additions and 1 deletions
+38
View File
@@ -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
+2 -1
View File
@@ -20,8 +20,9 @@ require('AppBorders')
-- CRITICAL FOR RAYCAST INTERACTION: Bind the return value to a global variable
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("FocusMode")
Network = require("NetworkCenter")
-- Load the window management module