tto / docs / macos / clipboard history with hammerspoon and clipboardtool

Install Hammerspoon

Use [brew] to install Hammerspoon:

brew install --cask hammerspoon

Install ClipboardTool Spoon

  1. Download the spoon from hammerspoon.org
  2. Unpack the file and open with Hammerspoon, this will add the spoon to ~/.hammerspoon/Spoons

Configure ClipboardTool

  1. Open or create the ~/.hammerspoon/init.lua file in your preferred text editor.
  2. Add the following Lua script to load, configure, and start the ClipboardTool:

     -- Load ClipboardTool Spoon
     hs.loadSpoon("ClipboardTool")
    
     -- Configure ClipboardTool
     spoon.ClipboardTool.show_copied_alert = true -- Show an alert when something is copied
     spoon.ClipboardTool.paste_on_select = true -- Automatically paste the selected item
    
     -- Bind ClipboardTool to a hotkey (Cmd + Shift + V)
     hs.hotkey.bind({"cmd", "shift"}, "v", function()
         spoon.ClipboardTool:toggleClipboard()
     end)
    
     -- Start ClipboardTool
     spoon.ClipboardTool:start()
    

Reload Hammerspoon Configuration

  1. Click on the Hammerspoon icon in the menu bar.
  2. Select “Reload Config” to apply the changes.

Use ClipboardTool

Notes

For more customization options and detailed usage, refer to the ClipboardTool spoon documentation.