Recommend a MacOS on the use of the unable to extricate App

Hammerspoon!

Hammerspoon is an automation tool for MacOS, and many articles about Hammerspoon focus on it as a window management tool, but Hammerspoon is much more than that.

Hammerspoon’s open source, free and supported plug-ins encapsulate most of the system-level interfaces into Lua apis, making this little hammer almost omnipresent and highly playable on MacOS.

What have I done with Hammerspoon?

  • The menu bar shows the weather in recent days
    • The reference sample
    • Request a free weather API to remind me not to forget my umbrella in this rainy city of Shenzhen.
  • Shear board history record

    • The reference sample
    • Record clipboard history, click on an item and copy it again.
  • Volume adjustment shortcut key

    • The reference sample

    • When I use the external keyboard, I customize the shortcut keys CMD + up/ Down to adjust the system volume

  • Window management

    • The reference sample
    • Shortcut keys to achieve two – screen, three – screen and full – screen
  • Wi-fi automatic script

    • The reference sample
    • Determine whether you are at home or at home based on the Wi-Fi SSID. For example, if the NAS server is mounted at home, mount the server directory on the SSHFS of the company.
  • Bluetooth headset automatically connects

    • The reference sample
    • The bluetooth headset automatically disconnects when the computer locks the screen, refer to my other introduction.
  • Automatic switching of input method

    • The reference sample
    • In each App interface automatically switch to Sogou input method, with sogou input method automatic Chinese and English switch, no longer need to switch back and forth between the system default English input method and Sogou input method.
  • Timed automatic submission of code

    • The reference sample
    • usehs.timerTimer, timing automatically push my notes and downloaded e-books to Github repository.
  • USB device connection records

    • The reference sample
    • Record the information of every USB device plugged into your computer.
  • Being pushed

    • The reference sample
    • Push any message reminder
  • TTS voice

    • The reference sample
    • callsay hello worldSynthetic TTS, simulated human pronunciation, so that Mac can speak.
  • More… (Can’t stop at all)

Other plug-in ideas

  • pomodoro
  • Application of search
  • Desktop widgets
  • .

Introduction to use

The ~/.Hammerspoon /init. Lua script can be configured to interact with the system with some basic Lua syntax. Then Happy Hacking

  • Lua Quick start tutorial
  • Hammerspoon API documentation

My reference configuration

If you are too lazy to configure, you can refer to my configuration and modify it according to your own needs

wangshub/hammerspoon-config

The last

Completely unable to stop, Hammerspoon has saved at least 30 minutes a day 😀⏱