fix: update dock for hammerspoon shortcuts

This commit is contained in:
Noah Masur 2022-12-20 18:22:24 -07:00
parent 50acdd0c58
commit 1b32457956
2 changed files with 18 additions and 5 deletions

View File

@ -1,9 +1,22 @@
{ config, ... }: { { config, pkgs, ... }: {
# Hammerspoon - MacOS custom automation scripting # Hammerspoon - MacOS custom automation scripting
home-manager.users.${config.user} = { home-manager.users.${config.user} = {
xdg.configFile.hammerspoon = { source = ./hammerspoon; }; xdg.configFile."hammerspoon/init.lua".source = ./hammerspoon/init.lua;
xdg.configFile."hammerspoon/Spoons/ControlEscape.spoon".source =
./hammerspoon/Spoons/ControlEscape.spoon;
xdg.configFile."hammerspoon/Spoons/DismissAlerts.spoon".source =
./hammerspoon/Spoons/DismissAlerts.spoon;
xdg.configFile."hammerspoon/Spoons/Launcher.spoon/init.lua".source =
pkgs.substituteAll {
src = ./hammerspoon/Spoons/Launcher.spoon/init.lua;
firefox = "${pkgs.firefox-bin}/Applications/Firefox.app";
discord = "${pkgs.discord}/Applications/Discord.app";
kitty = "${pkgs.kitty}/Applications/kitty.app";
};
xdg.configFile."hammerspoon/Spoons/MoveWindow.spoon".source =
./hammerspoon/Spoons/MoveWindow.spoon;
}; };
homebrew.casks = [ "hammerspoon" ]; homebrew.casks = [ "hammerspoon" ];

View File

@ -56,13 +56,13 @@ function obj:init()
-- Launcher shortcuts -- Launcher shortcuts
self.launcher:bind("ctrl", "space", function() end) self.launcher:bind("ctrl", "space", function() end)
self.launcher:bind("", "return", function() self.launcher:bind("", "return", function()
self:switch("kitty.app") self:switch("@kitty@")
end) end)
self.launcher:bind("", "C", function() self.launcher:bind("", "C", function()
self:switch("Calendar.app") self:switch("Calendar.app")
end) end)
self.launcher:bind("", "D", function() self.launcher:bind("", "D", function()
self:switch("Discord.app") self:switch("@discord@")
end) end)
self.launcher:bind("", "E", function() self.launcher:bind("", "E", function()
self:switch("Mail.app") self:switch("Mail.app")
@ -71,7 +71,7 @@ function obj:init()
self:switch("Music.app") self:switch("Music.app")
end) end)
self.launcher:bind("", "F", function() self.launcher:bind("", "F", function()
self:switch("Firefox.app") self:switch("@firefox@")
end) end)
self.launcher:bind("", "H", function() self.launcher:bind("", "H", function()
self:switch("Hammerspoon.app") self:switch("Hammerspoon.app")