It addresses my main concerns with Mjolnir (doesn’t require me to micromanage a constellation of modules nor bootstrap an entire Lua ecosystem management toolchain, and the documentation is great) and it has plenty of nice features, enabling me to easily attain parity with my Slate set-up and actually exceed it in short order. In my opinion now, Hammerspoon (itself a fork or Mjolnir, and one which Steven Degutis endorses) has crossed the threshold for community size, active maintenance, and stability that I feel comfortable adopting it, even though it required me to port my Slate configuration from JavaScript to Lua ( this is the result). I didn’t want to have to rewrite my extensive Slate config (probably even into another language) if the tool I was targeting was not going to stick around. Consider this insanely long list of window management tools for OS X. Steven Degutis alone has made half a dozen of them - AppGrid, Zephyros, Phoenix, Hydra, Penknife - before finally(?) settling on Mjolnir. I looked into the obvious alternatives and was flabbergastered to see them flashing in and out of existence at an alarming rate. I had a patch that fixed the main issue I was seeing, but at some point the app started silently crashing for me and I was never able to figure out why. I continued to use it for a long time if it ain’t broke, don’t fix it, right? Unfortunately, it was a little bit broken. I originally used Stay and Divvy, before discovering the joys of the open source Slate window manager, which allowed me a much higher degree of customization via its JavaScript config file format.Īlas, Slate became abandonware. plugging in or unplugging an external display, or launching an app). I use it for positioning windows using hot keys and in response to events (eg. I hope this post can help beginners to get started with hammerspoon (and spoons).Hammerspoon is a programmable OS X automation and scripting tool. The more you know about hammerspoon, the more you can control your MacOS. By the way, you can learn Lua by reading other’s hammerspoon config files. Hammerspoon is a powerful tool allowing you to have powerful effects on your system by writing Lua scripts. SetCaffeineDisplay(hs.caffeinate.get( " displayIdle ")) SetCaffeineDisplay(hs.caffeinate.toggle( " displayIdle "))Ĭaffeine:setClickCallback(caffeineClicked) But now I can create a menubar by the following config: caffeine = hs.menubar.new() I used to type caffeinate -t 99999 to make OS awake. Hs.wifi.associate(studySSID, " myPassPhrase ") Hs.hotkey.bind(hyperShift, ' 8 ', function() I would be greatful if anyone has a solution. I have managed to find two seperate ways to switch between app windows but none work across spaces. Cross monitor window tiling using cmd + alt +. Go to hammerspoon r/hammerspoon by drpoup Help: Switch focus to next app window (across spaces) Hi I have been trying for quite awhile to get this to work. Hs.wifi.associate(bedroomSSID, " myPassPhrase ") If you like or are using this config, please give it a for motivation :) Image of window management. Hs.hotkey.bind(hyperShift, ' 9 ', function() So I can config like this to make sure I can connect to the stronger one. In some rooms, the signal of router A is stronger, while in other rooms, router B is better. In modules/a : hyper = )ĪppWatcher = hs.(applicationWatcher) Now we can dive into a more complex task: windows manager. Then try to press cmd+option+t, the clock should appear again. Hs.hotkey.bind(hyper, ' t ', function() spoon.AClock:toggleShow() end) Now let’s start your first config script, edit the a file: hs.loadSpoon( " AClock ") You can see the clock display on the screen. Im using Hammerspoon to resize my windows on OSX. Then launch the hammerspoon console and input hs.loadSpoon( " AClock ")īingo! We just finish the hammerspoon version of “hello world” :) Let’s getting started.įirst, install hammerspoon, you can easily install it using homebrew: brew cask install hammerspoonĪnd make sure these files and folders exists: ~/.hammerspoonĭownload it and double click to unzip and install it, it will be installed in the Spoons folder. I hope this post can help beginners to get started with hammerspoon (and spoons). So I deceided to rewrite my hammerspoon config file with spoons. I have used hammerspoon for a long time, recently I found that the new version of hammerspoon supported Lua plugins called “Spoons”. Teddy Ma's Homepage | Powerful Hammerspoon docs hs.window.layout move : moves the window(s) to a specified onscreen rect (if the action is omitted, move is assumed) minimize, maximize, fullscreen.
0 Comments
Leave a Reply. |