
- #Hammerspoon hyper key how to
- #Hammerspoon hyper key install
- #Hammerspoon hyper key software
- #Hammerspoon hyper key mac
And if you want to know more about any part of the API, you will find that it is very well documented. You can go to Hammerspoon’s Getting started guide to see some more examples. show ( "Connected to Wi-Fi network", "", net, "" ) end end ) wifiwatcher : start () More show ( "You lost Wi-Fi connection", "", "", "" ) else hs.notify. currentNetwork () if net = nil then hs.notify. watcher.new ( function () local net = hs.wifi. You can replace the modifier combination with a hyper key if you want The following are a couple of basic examples of what you can do with Hammerspoon.You can split your config into separate files (and you should, if you do any serious configuring), and then use the require function to import them This is the starting point of your config.Using either Homebrew or from the website Configuring Setup Basically, you’re only limited by your imagination (and your skill at writing the relevant code). It has numerous APIs for macOS functionality, and with it, you can control pretty much whatever you want to. Simply put, it is a automation tool running on Lua. Eventually, I gained an interest in configuring my system to suit me better, and I came across Hammerspoon. I won’t go into what that was like here, as there are many people on the internet who have told their stories of learning Vim. However, since I am doing a CS degree, I needed to get familiar with programming related tools, and that is how I found Vim.
#Hammerspoon hyper key software
I do still occasionally boot into Windows, using Bootcamp, but it’s only when I need to use some software that doesn’t run on macOS.Īt first, I used macOS much like I used to use Windows.

Once I moved to macOS, it took quite some time to get used to it. I have used Ubuntu a bit, but that barely counts. Before that, I had only ever known Windows. My approach was to check the current computer’s hostname to figure out which computer I want to switch to.I’ve been using macOS for a little over a year now.

Now that you have the right input values for the monitor, it’s fast to throw together a hotkey. I: VCP control #96 (0圆0) = current: 27, max: 18 Create a Hammerspoon hotkey to switch the display # When I ran it on my laptop, I got a current value of 27 (USB-C): $ ~/.ddcctl/ddcctl -d 1 -i ? When I ran it on my desktop, I got a current value of 15 (DisplayPort 1): $ ~/.ddcctl/ddcctl -d 1 -i ? Just use the ddcctl -d 1 -i "?" command on each of your computers. Turns out you can just ask the monitor which input source is active using ddcctl, which will save some guess and check.

However, I found it to be incomplete–for example, my monitor’s USB-C input source is not in the table. There is a table of input sources on ddcctl’s README. Figure out which input each computer is on # Repeat this process on your second computer. Check it real quick you should see output like this: $ ~/.ddcctl/ddcctlĭ: NSScreen #724072469 (3440x1440 0°) 109.00 DPI Resolution: 3440 x 1440 (UWQHD - Ultra-Wide Quad HD )įramebuffer Depth: 30-Bit Color (ARGB2101010 )Īs you can see from the output above, I have both Intel and AMD (Radeon) cards, but I have my computer set to always use the Radeon no matter what. Metal: Supported, feature set macOS GPUFamily2 v1

Note whether you’re using an amd, nvidia, or intel card. Use system_profiler to figure out what graphics card you are using. I’ve chosen to clone it at ~/.ddcctl: $ git clone ~/.ddcctl Among other things, it lets you switch inputs!įirst, clone ddcctl.
#Hammerspoon hyper key install
Install ddcctl on both computers #ĭdcctl is a simple command line program that lets you talk to your monitor using the Display Data Channel protocol.
#Hammerspoon hyper key how to
I’ll show you how to set up a single hot key with Hammerspoon to seamlessly switch between computers. Until now, I’ve been manually switching between computers dozens of times a day by menu diving on the actual monitor.
#Hammerspoon hyper key mac
I have a Dell 3419UW monitor, with my work Macbook plugged into the USB-C input, and my personal desktop Mac plugged into DisplayPort 1. Create a Hammerspoon hotkey to switch the display.Figure out which input each computer is on.Create a quick monitor input switcher with Hammerspoon
