aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Singleton <matt@xcolour.net>2016-04-16 12:06:16 -0400
committerMatt Singleton <matt@xcolour.net>2016-04-16 12:06:16 -0400
commitf97262188b674b170309a330adae6f5211373920 (patch)
treef0989bca40587207f21d7f49d830e6f77eea1406
parent1e15fb7e6565baed1a799ec2ad439aaad3e6f7fc (diff)
switch from mjolnir to hammerspoon for mac window management
-rwxr-xr-xdeploy.sh4
-rw-r--r--hammerspoon/init.lua38
-rw-r--r--mjolnir/init.lua38
3 files changed, 40 insertions, 40 deletions
diff --git a/deploy.sh b/deploy.sh
index 1007b6c..a2ba314 100755
--- a/deploy.sh
+++ b/deploy.sh
@@ -6,12 +6,12 @@ rm -rf dotfiles-backup
mkdir -p dotfiles-backup
# deploy
-for f in vimrc gvimrc gitconfig gitignore zshrc zsh dircolors.conf slate tmux.conf
+for f in vimrc gvimrc gitconfig gitignore zshrc zsh dircolors.conf slate tmux.conf hammerspoon
do
if [ -e ~/.${f} ]; then
mv ~/.${f} dotfiles-backup/${f}
fi
- ln -sf `pwd`/${f} ~/.${f}
+ ln -sf "$(pwd)/${f}" ~/.${f}
done
if [ ! -d ~/.vim/bundle/vundle ]; then
diff --git a/hammerspoon/init.lua b/hammerspoon/init.lua
new file mode 100644
index 0000000..c745976
--- /dev/null
+++ b/hammerspoon/init.lua
@@ -0,0 +1,38 @@
+local window = require "hs.window"
+local hotkey = require "hs.hotkey"
+
+window.animationDuration = 0
+
+hotkey.bind({"alt"}, "0", function()
+ local win = window.focusedWindow()
+ win:maximize()
+end)
+
+hotkey.bind({"alt"}, "left", function()
+ local win = window.focusedWindow()
+ if win ~= nil then
+ win:moveToUnit({x=0, y=0, w=0.5, h=1})
+ end
+end)
+
+hotkey.bind({"alt"}, "right", function()
+ local win = window.focusedWindow()
+ if win ~= nil then
+ win:moveToUnit({x=0.5, y=0, w=0.5, h=1})
+ end
+end)
+
+hotkey.bind({"alt"}, "down", function()
+ local win = window.focusedWindow()
+ if win ~= nil then
+ win:moveToUnit({x=0.167, y=0, w=0.666, h=1})
+ end
+end)
+
+hotkey.bind({"alt"}, "r", function()
+ hs.reload()
+end)
+
+hotkey.bind({"alt"}, "c", function()
+ hs.openConsole()
+end)
diff --git a/mjolnir/init.lua b/mjolnir/init.lua
deleted file mode 100644
index 5b9bad4..0000000
--- a/mjolnir/init.lua
+++ /dev/null
@@ -1,38 +0,0 @@
-local application = require "mjolnir.application"
-local window = require "mjolnir.window"
-local hotkey = require "mjolnir.hotkey"
-local fnutils = require "mjolnir.fnutils"
-
-hotkey.bind({"alt"}, "0", function()
- local win = window.focusedwindow()
- win:maximize()
-end)
-
-hotkey.bind({"alt"}, "left", function()
- local win = window.focusedwindow()
- if win ~= nil then
- win:movetounit({x=0, y=0, w=0.5, h=1})
- end
-end)
-
-hotkey.bind({"alt"}, "right", function()
- local win = window.focusedwindow()
- if win ~= nil then
- win:movetounit({x=0.5, y=0, w=0.5, h=1})
- end
-end)
-
-hotkey.bind({"alt"}, "down", function()
- local win = window.focusedwindow()
- if win ~= nil then
- win:movetounit({x=0.167, y=0, w=0.666, h=1})
- end
-end)
-
-hotkey.bind({"alt"}, "r", function()
- mjolnir:reload()
-end)
-
-hotkey.bind({"alt"}, "c", function()
- mjolnir.openconsole()
-end)