6/5/2023 0 Comments Hammerspoon hacks![]() ![]() ![]() It’s been translated into Arabic, Bengali, Catalan, Chinese (Simplified & Traditional), Danish, Dutch, French, German, Greek, Hindi, Hungarian, Italian, Japanese, Korean, Malayalam, Norwegian, Panjabi/Punjabi, Polish, Portuguese, Russian, Spanish, Swedish, Ukrainian & Vietnamese by our awesome community. It’s been downloaded over 163 thousand times, and there are over 2.6 thousands members in our Facebook Community. CommandPost is a free and open source macOS application that bridges between control surfaces and software that doesn’t support them natively, such as Apple’s Final Cut Pro and Adobe’s After Effects. '.' elseif string.len ( newEntry ) < obj.helperEntryLengthInChar then newEntry = newEntry. funcName - make sure each entry is of the same length if string.len ( newEntry ) > obj.helperEntryLengthInChar then newEntry = string.sub ( newEntry, 1, obj.helperEntryLengthInChar - 2 ). Function to compare two letters - It sorts according to the ASCII code, and for letters, it will be alphabetical - However, for capital letters (65-90), I'm adding 32.5 (this came from 97 - 65 + 0.5, where 97 is a and 65 is A) to the ASCII code before comparing - This way, each capital letter comes after the corresponding simple letter but before letters that come after it in the alphabetical order local function compareLetters ( a, b ) asciiA = te ( a ) asciiB = te ( b ) if asciiA >= 65 and asciiA = 65 and asciiB '. A function called compareLetters is added, and the beginning of the for loop(in showHelper), and the part just before it are changed as shown The following code is to be added to RecursiveBinder.spoon/a.To fix this, I added some more code to sort the helper text before showing. If you used this, you may have noticed that the order of the keys in the helper text is not consistent.One to reload the config, and the other to open the config in VSCode Bonus Sorted helper text Here, I’ve also included a couple of keybindings for Hammerspoon. For example, singleKey('o', 'open') returns, 'space', spoon.RecursiveBinder.This is a convenience function used to easily create a table representing a keybinding with no modifiers, and also automatically translate capital letters to normal letters with shift modifier.Your ~/.hammerspoon directory should now look something like this:.It turned out that there was a Spoon for Hammerspoon called RecursiveBinder that could do the same thing. It wasn’t that long since I had been introduced to Vim, and I was getting comfortable with the leader key system.But I soon hit a roadblock where I was using up all the keys (or at least the most easily accessible ones) When I first started configuring Hammerspoon, I setup a hyper key, and added a few keybindings.Now let’s jump into the RecursiveBinder Spoon RecursiveBinder Spoon About And you can find many resources out there about setting up various things using Hammerspoon. You can also find ‘Spoons’, which are basically plugins which provide additional functionality, at this link. 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
0 Comments
Leave a Reply. |