Skip to content

Commit

Permalink
Merge pull request #25 from jasonrudolph/improve-hammerspoon-setup
Browse files Browse the repository at this point in the history
Make it easier to use jasonrudolph/keyboard in combination with other Hammerspoon customizations
  • Loading branch information
jasonrudolph authored Jun 3, 2017
2 parents afdf94e + c3742e7 commit 7bc82ff
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 13 deletions.
16 changes: 8 additions & 8 deletions hammerspoon/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ enableHotkeyForWindowsMatchingFilter = function(windowFilter, hotkey)
end)
end

require('control-escape')
require('delete-words')
require('hyper')
require('markdown')
require('microphone')
require('panes')
require('super')
require('windows')
require('keyboard.control-escape')
require('keyboard.delete-words')
require('keyboard.hyper')
require('keyboard.markdown')
require('keyboard.microphone')
require('keyboard.panes')
require('keyboard.super')
require('keyboard.windows')

hs.notify.new({title='Hammerspoon', informativeText='Ready to rock 🤘'}):send()
2 changes: 1 addition & 1 deletion hammerspoon/markdown.lua
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ end

markdownMode = hs.hotkey.modal.new({}, 'F20')

local message = require('status-message')
local message = require('keyboard.status-message')
markdownMode.statusMessage = message.new('Markdown Mode (control-m)')
markdownMode.entered = function()
markdownMode.statusMessage:show()
Expand Down
2 changes: 1 addition & 1 deletion hammerspoon/microphone.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
local message = require('status-message')
local message = require('keyboard.status-message')

local messageMuting = message.new('muted 🎤')
local messageHot = message.new('hot 🎤')
Expand Down
2 changes: 1 addition & 1 deletion hammerspoon/super.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
local eventtap = hs.eventtap
local eventTypes = hs.eventtap.event.types
local message = require('status-message')
local message = require('keyboard.status-message')

-- If 's' and 'd' are *both* pressed within this time period, consider this to
-- mean that they've been pressed simultaneously, and therefore we should enter
Expand Down
2 changes: 1 addition & 1 deletion hammerspoon/windows.lua
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ end

windowLayoutMode = hs.hotkey.modal.new({}, 'F16')

local message = require('status-message')
local message = require('keyboard.status-message')
windowLayoutMode.statusMessage = message.new('Window Layout Mode (control-s)')
windowLayoutMode.entered = function()
windowLayoutMode.statusMessage:show()
Expand Down
10 changes: 9 additions & 1 deletion script/setup
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,22 @@ brew bundle check || brew bundle
ln -sfn $PWD/karabiner ~/.config/

# Prepare custom settings for Hammerspoon
ln -sfn $PWD/hammerspoon ~/.hammerspoon
mkdir -p ~/.hammerspoon
if ! grep -sq "require('keyboard')" ~/.hammerspoon/init.lua; then
echo "require('keyboard') -- Load Hammerspoon bits from https://github.com/jasonrudolph/keyboard" >> ~/.hammerspoon/init.lua
fi
ln -sfn $PWD/hammerspoon ~/.hammerspoon/keyboard

# Prepare custom settings for navigating between words in iTerm2
grep -sq forward-word ~/.inputrc || cat $PWD/inputrc >> ~/.inputrc

# Disable Dock icon for Hammerspoon
defaults write org.hammerspoon.Hammerspoon MJShowDockIconKey -bool FALSE

# If Hammerspoon is already running, kill it so we can pick up the new config
# when opening Hammerspoon below
killall Hammerspoon || true

# Open Apps
open /Applications/Hammerspoon.app
open /Applications/Karabiner-Elements.app
Expand Down

0 comments on commit 7bc82ff

Please sign in to comment.