mirror of
https://github.com/nmasur/dotfiles
synced 2024-11-09 23:22:57 +00:00
draw switcher indicator on screen
This commit is contained in:
parent
244c431c75
commit
ba3aa9cd93
@ -8,17 +8,34 @@ obj.name = "Launcher"
|
||||
obj.version = "0.1"
|
||||
obj.license = "MIT - https://opensource.org/licenses/MIT"
|
||||
|
||||
function drawSwitcher()
|
||||
-- Drawing
|
||||
canv = hs.canvas.new({ x = 850, y = 1, h = 3, w = 120 })
|
||||
canv[#canv + 1] = {
|
||||
action = "build",
|
||||
type = "rectangle",
|
||||
}
|
||||
canv[#canv + 1] = {
|
||||
type = "rectangle",
|
||||
fillColor = { alpha = 1, red = 0.8, green = 0.6, blue = 0.3 },
|
||||
action = "fill",
|
||||
}
|
||||
return canv:show()
|
||||
end
|
||||
|
||||
function obj:init()
|
||||
-- Begin launcher mode
|
||||
self.launcher = hs.hotkey.modal.new("ctrl", "space")
|
||||
|
||||
-- Behaviors on enter
|
||||
function self.launcher:entered()
|
||||
-- hs.alert'Entered mode'
|
||||
-- hs.alert("Entered mode")
|
||||
self.canv = drawSwitcher()
|
||||
end
|
||||
-- Behaviors on exit
|
||||
function self.launcher:exited()
|
||||
-- hs.alert'Exited mode'
|
||||
-- hs.alert("Exited mode")
|
||||
self.canv:hide()
|
||||
end
|
||||
|
||||
-- Use escape to exit launcher mode
|
||||
|
Loading…
Reference in New Issue
Block a user