Last active
January 4, 2017 23:34
-
-
Save tekkoc/d53433eca4318a3a7cbf0872519cb484 to your computer and use it in GitHub Desktop.
Amethystの補助としてSlateを使用する例
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Amethystと併用を前提 | |
// Amethystの「Display current layout」をオフにすること | |
var util = { | |
// alt + shift + .. | |
key: function(k, mod) { | |
return k + ':alt,shift' + (mod ? ',' + mod : ''); | |
} | |
}; | |
// i .. 下に隠れているウィンドウをフォーカス | |
slate.bind(util.key('i'), slate.operation('focus', { direction: 'behind' })); | |
// q .. フォーカスしているアプリを終了 | |
slate.bind(util.key('q'), function(win) { | |
var pid = win.app().pid(); | |
slate.log('Kill process ' + pid); | |
win.doOperation( | |
slate.operation('shell', { | |
'command' : '/bin/kill '+ pid | |
}) | |
); | |
}); | |
// r .. Amethystを再起動 | |
slate.bind(util.key('r'), function(win) { | |
win.doOperation( | |
slate.operation('shell', { | |
'command' : '/usr/bin/killall Amethyst' | |
}) | |
); | |
win.doOperation( | |
slate.operation('shell', { | |
'command' : '/usr/bin/open -a Amethyst' | |
}) | |
); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment