/HammerSpoon

😌HammerSpoon config file, 💻Window Management, 🎵VOX, VIM-binding #KillThe🐁

Primary LanguageLuaMIT LicenseMIT

HammerSpoon config file - by S1ngS1ng

English Chinese

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 and togglePlaylist
    • Retrieve song information such as song title, artist, album, playerState and so on
  • NEW Feature Global VIM-like Key Binding (Thanks to @A-RON)
    • Ctrl + hjkl for Left, Down, Up and Right
    • Works with combinations of Alt, Cmd and Shift

Example

VIM Key Binding

vim-key-binding

VOX

  • Show track info (Track Title, Album, Artist)

TrackInfo

Window Management

  • Centering and Maximize

Imgur

  • Half the screen

Imgur

  • Resize (anchor top, left)

Imgur

  • Resize (anchor bottom, right)

Imgur

Install

Shortcuts

Window Management

  • Move window to another screen
    • Ctrl-Alt + Left - Set current window to the Left screen
    • Ctrl-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 Left
    • Ctrl-Alt-Command + Right - Half the width, stick to Right
    • Ctrl-Alt-Command + Up - Half the width, stick to Top
    • Ctrl-Alt-Command + Down - Half the width, stick to Bottom
  • Adjust window size (anchor top, left)
    • Ctrl-Alt-Shift + Left - Move Right edge to the Left
    • Ctrl-Alt-Shift + Right - Move Right edge to the Right
    • Ctrl-Alt-Shift + Up - Move Bottom edge Up
    • Ctrl-Alt-Shift + Down - Move Bottom edge Down
  • Adjust window size (anchor right, bottom)
    • Alt-Command-Shift + Left - Move Left edge to the Left
    • Alt-Command-Shift + Right - Move Left edge to the Right
    • Alt-Command-Shift + Up - Move Top edge Up
    • Alt-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 screen
    • Ctrl-Alt-Command + i - Move window to the "relative" right and resize to half of the screen

VOX

  • Alt-Command-Shift + J - Toggle Play and Pause
  • Alt-Command-Shift + H - Previous song
  • Alt-Command-Shift + L - Next song
  • Alt-Command-Shift + K - Display track information
  • Alt-Command-Shift + I - Toggle Playlist

VIM-like key binding (I already map Ctrl to CapsLock)

  • Basic
    • Ctrl + h - Left
    • Ctrl + j - Down
    • Ctrl + k - Up
    • Ctrl + l - Right
  • Use with Alt
    • Ctrl-Alt + H - Move caret Left by 1 word
    • Ctrl-Alt + L - Move caret Right by 1 word
  • Use with Cmd
    • Ctrl-Cmd + H - Move caret to the start of line
    • Ctrl-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

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