HammerSpoon config file - by S1ngS1ng
tl;dr Click Me
Features
- Window Management
- Maximize window (not the full-screen mode)
- Move window to another screen
- Set window size immediately to half of the current screen toward ANY direction
- Stretch or shrink window size toward ANY direction
- NEW Feature Windows-like "relative" window cycle, just like
winKey + left/right
on Windows OS
- NEW Feature VOX Music Player - Now merged as hs.vox
- Basic commands such as
play
,pause
,next
,forward
,fastForward
,increaseVolume
and so on - Advanced commands such as
addurl
,playurl
andtogglePlaylist
- Retrieve song information such as
song title
,artist
,album
,playerState
and so on
- Basic commands such as
- NEW Feature Global VIM-like Key Binding (Thanks to @A-RON)
Ctrl
+hjkl
forLeft, Down, Up and Right
- Works with combinations of
Alt
,Cmd
andShift
Example
VIM Key Binding
VOX
- Show track info (Track Title, Album, Artist)
Window Management
- Centering and Maximize
- Half the screen
- Resize (anchor top, left)
- Resize (anchor bottom, right)
Install
- Install HammerSpoon FIRST
- Download, Copy or
git clone
the following files:- init.lua - Main entrance
- key-binding.lua - Key mapping for window-management
- vim-binding.lua - vim-like key binding
- vox-control.lua - VOX player control
- window-management.lua - Window management
- Put
init.lua
,key-binding.lua
,vim-binding.lua
,vox-control.lua
andwindow-management.lua
in ~/.hammerspoon
Shortcuts
Window Management
- Move window to another screen
Ctrl-Alt + Left
- Set current window to the Left screenCtrl-Alt + Right
- Set current window to the Right screen
- Set window size to full screen
Ctrl-Alt-Command + M
- Set window to center (keep window height)
Ctrl-Alt-Command + C
- Set window size to EXACTLY half of the current screen
Ctrl-Alt-Command + Left
- Half the width, stick to LeftCtrl-Alt-Command + Right
- Half the width, stick to RightCtrl-Alt-Command + Up
- Half the width, stick to TopCtrl-Alt-Command + Down
- Half the width, stick to Bottom
- Adjust window size (anchor top, left)
Ctrl-Alt-Shift + Left
- Move Right edge to the LeftCtrl-Alt-Shift + Right
- Move Right edge to the RightCtrl-Alt-Shift + Up
- Move Bottom edge UpCtrl-Alt-Shift + Down
- Move Bottom edge Down
- Adjust window size (anchor right, bottom)
Alt-Command-Shift + Left
- Move Left edge to the LeftAlt-Command-Shift + Right
- Move Left edge to the RightAlt-Command-Shift + Up
- Move Top edge UpAlt-Command-Shift + Down
- Move Top edge Down
- Windows-like window cycle (Just like winKey + left/right on Windows OS)
Ctrl-Alt-Command + u
- Move window to the "relative" left and resize to half of the screenCtrl-Alt-Command + i
- Move window to the "relative" right and resize to half of the screen
VOX
Alt-Command-Shift + J
- Toggle Play and PauseAlt-Command-Shift + H
- Previous songAlt-Command-Shift + L
- Next songAlt-Command-Shift + K
- Display track informationAlt-Command-Shift + I
- Toggle Playlist
Ctrl
to CapsLock
)
VIM-like key binding (I already map - Basic
Ctrl + h
- LeftCtrl + j
- DownCtrl + k
- UpCtrl + l
- Right
- Use with
Alt
Ctrl-Alt + H
- Move caret Left by 1 wordCtrl-Alt + L
- Move caret Right by 1 word
- Use with
Cmd
Ctrl-Cmd + H
- Move caret to the start of lineCtrl-Cmd + L
- Move caret to the end of line
- Use with
Shift
- For all the listed above, hold
Shift
at the same time will do selection
- For all the listed above, hold
Tips
- I would recommend to disable animation. Especially for resize anchoring Bottom, Right
- Feel free to open an issue or submit your Pull Request ^_^
- Any suggestions, comments, thoughts are all welcome