mirror of
https://github.com/nmasur/dotfiles
synced 2025-04-24 15:02:24 +00:00
Compare commits
No commits in common. "183babd2f09d7cb4b33090701446f6efe21448ce" and "31170a616f4a32f2db3dc5e19ee90bbf726cc303" have entirely different histories.
183babd2f0
...
31170a616f
@ -88,9 +88,8 @@
|
|||||||
settings = {
|
settings = {
|
||||||
|
|
||||||
# Add community Cachix to binary cache
|
# Add community Cachix to binary cache
|
||||||
substituters = lib.mkIf (!pkgs.stdenv.isDarwin)
|
substituters = [ "https://nix-community.cachix.org" ];
|
||||||
[ "https://nix-community.cachix.org" ];
|
trusted-public-keys = [
|
||||||
trusted-public-keys = lib.mkIf (!pkgs.stdenv.isDarwin) [
|
|
||||||
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
|
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@ -8,44 +8,44 @@ obj.name = "Launcher"
|
|||||||
obj.version = "0.1"
|
obj.version = "0.1"
|
||||||
obj.license = "MIT - https://opensource.org/licenses/MIT"
|
obj.license = "MIT - https://opensource.org/licenses/MIT"
|
||||||
|
|
||||||
local width = hs.screen.mainScreen():fullFrame().w
|
function DrawSwitcher()
|
||||||
local switcherWidth = 500
|
-- Drawing
|
||||||
obj.canvas = hs.canvas.new({
|
local width = hs.screen.mainScreen():fullFrame().w
|
||||||
|
local switcherWidth = 500
|
||||||
|
local canv = hs.canvas.new({
|
||||||
x = width / 2 - switcherWidth / 2,
|
x = width / 2 - switcherWidth / 2,
|
||||||
y = 1,
|
y = 1,
|
||||||
h = 3,
|
h = 3,
|
||||||
w = switcherWidth,
|
w = switcherWidth,
|
||||||
})
|
})
|
||||||
-- Draw switcher
|
canv[#canv + 1] = {
|
||||||
obj.canvas[#obj.canvas + 1] = {
|
|
||||||
action = "build",
|
action = "build",
|
||||||
type = "rectangle",
|
type = "rectangle",
|
||||||
}
|
}
|
||||||
obj.canvas[#obj.canvas + 1] = {
|
canv[#canv + 1] = {
|
||||||
type = "rectangle",
|
type = "rectangle",
|
||||||
fillColor = { alpha = 1, red = 0.8, green = 0.6, blue = 0.3 },
|
fillColor = { alpha = 1, red = 0.8, green = 0.6, blue = 0.3 },
|
||||||
action = "fill",
|
action = "fill",
|
||||||
}
|
}
|
||||||
|
return canv:show()
|
||||||
|
end
|
||||||
|
|
||||||
function obj:init()
|
function obj:init()
|
||||||
-- Begin launcher mode
|
-- Begin launcher mode
|
||||||
if self.launcher == nil then
|
if self.launcher == nil then
|
||||||
self.launcher = hs.hotkey.modal.new("ctrl", "space")
|
self.launcher = hs.hotkey.modal.new("ctrl", "space")
|
||||||
|
|
||||||
print(self.canvas)
|
|
||||||
print(obj.canvas)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Behaviors on enter
|
-- Behaviors on enter
|
||||||
function self.launcher:entered()
|
function self.launcher:entered()
|
||||||
-- hs.alert("Entered mode")
|
-- hs.alert("Entered mode")
|
||||||
obj.canvas:show()
|
self.canv = DrawSwitcher()
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Behaviors on exit
|
-- Behaviors on exit
|
||||||
function self.launcher:exited()
|
function self.launcher:exited()
|
||||||
-- hs.alert("Exited mode")
|
-- hs.alert("Exited mode")
|
||||||
obj.canvas:hide()
|
self.canv:hide()
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Use escape to exit launcher mode
|
-- Use escape to exit launcher mode
|
||||||
@ -54,8 +54,7 @@ function obj:init()
|
|||||||
end)
|
end)
|
||||||
|
|
||||||
-- Launcher shortcuts
|
-- Launcher shortcuts
|
||||||
self.launcher:bind("ctrl", "space", function()
|
self.launcher:bind("ctrl", "space", function() end)
|
||||||
end)
|
|
||||||
self.launcher:bind("", "return", function()
|
self.launcher:bind("", "return", function()
|
||||||
self:switch("@kitty@")
|
self:switch("@kitty@")
|
||||||
end)
|
end)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user