1/13/2024 0 Comments Bind a hotkey hammerspoon example![]() ![]() Most computers have a series of processes that are always running in the background rather than waiting for a user to launch them and interact with them. You are probably already familiar with the notion of daemons, even if the word seems new. QMK - If your keyboard supports custom firmware you can use QMK to configure the hardware device itself so the remaps works for any machine you use the keyboard with.Windows - Builtin in Control Panel, AutoHotkey or SharpKeys.macOS - karabiner-elements, skhd or BetterTouchTool.Some software resources to get started on the topic: Having remaps being keyboard or software specific.Caps Lock key is remapped to Esc if you quickly tap it, but is remapped to Ctrl if you hold it and use it as a modifier. pressing shift five times toggles Caps Lock. There are even more complex modifications you can configure: your long email address or your MIT ID number. Here, some software listens for a specific key combination and executes some script whenever that event is detected. This is useful for common tasks that you perform. You can also map keys to arbitrary commands of your choosing. Swapping Ctrl and the Meta (Windows or Command) key.We (the instructors) highly encourage this setting since Caps Lock has a very convenient location but is rarely used. This usually involves some software that is listening and, whenever a certain key is pressed, it intercepts that event and replaces it with another event corresponding to a different key. As with pretty much anything in your computer, it is configurable (and worth configuring). Hammerspoon (desktop automation on macOS)Īs a programmer, your keyboard is your main input method.I hope this post can help beginners to get started with hammerspoon (and spoons). 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: I used to type caffeinate -t 99999 to make OS awake. Hs.wifi.associate(studySSID, " myPassPhrase ") Hs.hotkey.bind(hyperShift, ' 8 ', function() Hs.wifi.associate(bedroomSSID, " myPassPhrase ") 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. HyperShift = )Ī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: You can see the clock display on the screen. Then launch the hammerspoon console and inputīingo! We just finish the hammerspoon version of “hello world” :) Let’s getting started.įirst, install hammerspoon, you can easily install it using homebrew:Īnd make sure these files and folders exists:ĭownload it and double click to unzip and install it, it will be installed in the Spoons folder. 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
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |