diff --git a/roles/hammerspoon/tasks/main.yaml b/roles/hammerspoon/tasks/main.yaml new file mode 100644 index 0000000..55fcb2b --- /dev/null +++ b/roles/hammerspoon/tasks/main.yaml @@ -0,0 +1,18 @@ +--- +- set_fact: + config_dir: '{{ansible_env.HOME}}/.hammerspoon' + +- name: create config directory + file: + state: directory + path: '{{config_dir}}' + +- name: install config file + template: + src: init.lua + dest: '{{config_dir}}/init.lua' + +- name: install homebrew package + homebrew: + state: latest + name: hammerspoon diff --git a/roles/hammerspoon/templates/init.lua b/roles/hammerspoon/templates/init.lua new file mode 100644 index 0000000..1ad6245 --- /dev/null +++ b/roles/hammerspoon/templates/init.lua @@ -0,0 +1,15 @@ +hs.hotkey.bind({'alt', 'cmd'}, 'B', function() + hs.application.launchOrFocus('Firefox') +end) + +hs.hotkey.bind({'alt', 'cmd'}, 'T', function() + hs.application.launchOrFocus('kitty') +end) + +hs.hotkey.bind({'alt', 'cmd'}, 'F', function() + hs.application.launchOrFocus('Ferdium') +end) + +pcall(function() + require('local') +end)