Part one, to be continued.
According to the wording on its official website,
a tool for powerful automation of OS X.
I use it with
Amethyst to manage the windows, and apart from that, here is how I use it:
- text editing with markdown;
- work/rest timer;
- double confirm when pressing
⌘ + Q;
- one hotkey to toggle day&night mode;
Credits go to @dbmrq, dotfiles/home/.hammerspoon at master · dbmrq/dotfiles · GitHub
I use two of his plugins (let’s just call it that).
For slowq, it prevents you from quit your app when you accidentally press ⌘+Q, instead you need to hold for 2/3s to quit.
To use it, download the file, put it in your
~/.hammerspoon/ folder, then you just need to put one line of code in your
For work timer, you just need to add 3 lines of code:
Then just press the hotkey and you will get a progress bar at the top of your screen, i just did a little tweek around, change the work/rest to emojis 🍅/☕️.
Hotkey to toggle night mode
First, I googled and write a little function in lua to read applescript files.
-- function: read applescript content. copy content to data
Then I assign a hotkey to call the applescript, long way…
The content of the applescript file is simple:
tell application "System Events"
For window management and text editing part, let’s talk about it next time.