restfar.blogg.se

Hammerspoon hyper key
Hammerspoon hyper key












hammerspoon hyper key
  1. #HAMMERSPOON HYPER KEY HOW TO#
  2. #HAMMERSPOON HYPER KEY FULL#
  3. #HAMMERSPOON HYPER KEY CODE#
  4. #HAMMERSPOON HYPER KEY WINDOWS#
hammerspoon hyper key

I've been using Headspace daily for about a month. tracking presets per space… or a custom input at any time.Block distracting a shortcuts to protect focus.Launch relevant applications and quit distracting applications based on tags.Define workspaces for your important work:.Fully configurable for you and your work-style.

hammerspoon hyper key

If you want to share this video with someone, it's on youtube. Headspace has been the title of this series, and it's what I call the last automation in this series. I'm pretty sure that I've been working on it alongside the name-sake tool for a straight month. Just add the following at the very end of a: - watch config for changes and reload when they occur Hammerspoon also supports reloading its configuration files upon detecting changes. Hs.hotkey.bind(hyper, 'l', gridset(1, 0, 1, 2)) - right half Hs.hotkey.bind(hyper, 'k', hs.grid.maximizeWindow) Hs.hotkey.bind(hyper, 'h', gridset(0, 0, 1, 2)) - left half Hs.hotkey.bind(hyper, 'j', toNextScreen()) function to move window one screen left or back if it's already on theĬurrentWindow = hs.window.focusedWindow() Os.execute("open /Applications/iTerm.app")Ĭonfiguring Window Movement Hotkeys - a helper function that returns another function that resizes the current window Os.execute("/System/Library/CoreServices/Menu\\ Extras/nu/Contents/Resources/CGSession -suspend") These two actions can be bound to keys via: - locking Stuff I regularly want to do is get an iTerm open or locking the screen.

hammerspoon hyper key

I want to automate a few things via hotkeys.

#HAMMERSPOON HYPER KEY HOW TO#

How to achieve that thou is left as an exercise for the interested reader -) Easy bits first - application launching This combination of keys might also be mapped to a single key by virtue of Karabiner, a cool program allowing arbitrary key remappings and much much. I also define that I want a window grid size of 2x2, with no margins: local hyper = I use a set of modifier keys for all of the hotkeys, let's call that set hyper. So let's have a look at that:įirst, Hammerspoon's config resides in the file ~/.hammerspoon/a.

#HAMMERSPOON HYPER KEY WINDOWS#

For me, these are arranging windows grid-like on screen and have e.g. However, if you have about 30min at hand, you can already hammer out a nice configuration for the things that are most important for you to automate or hotkey. The configuration (it basically comes with no defaults) can be a bit daunting in the beginning - in fact, I had stumbled upon Hammerspoon already some time ago but didn't invest the effort back then.

#HAMMERSPOON HYPER KEY CODE#

The following code snippets have been heavily inspired (read: copied) by philipalexander's, tstirrat's and cmsj's Hammerspoon configs on Github and also by Tristan Hume's post on configuring Mjolnir, of which Hammerspoon is a fork. if Thunderbolt Display connected, put Xcode on that one and Mail on the internal one)

  • watch the name and number of screens connected and position windows accordingly (e.g.
  • unmount USB devices upon switching to battery power.
  • switch sound on or off, depending on the available wifi networks.
  • Just some examples of what you can do with Hammerspoon: Not only can you access that single API, but also check for USB devices, Wifi names, attached screens and so on - all controlable with small Lua scripts. nudge a window a bit to the right.Įnter Hammerspoon: First and foremost, Hammerspoon provides you with scriptable access to OSX's accessibility API - and whatever you do with that, you can bind to a hotkey.

    #HAMMERSPOON HYPER KEY FULL#

    Lately I've been using Magnet (formerly known as Window Magnet, App Store, $4.99), which is pretty nice but I felt it is not using the concept of moving stuff around with the keyboard to the full extent: While you can surely put windows in one quadrant of the screen or something, there's no option to e.g. Being a big fan of using the keyboard for everything and not touching the mouse more than necessary, I went through different OSX helper applications for helping to move windows around, aligning them on screen, etc.














    Hammerspoon hyper key