
For more information about the event flags, see the official documentationĮxtensions/pathwatcher/libpathwatcher.m line 83Įxtensions/pathwatcher/libpathwatcher.m line 153Įxtensions/pathwatcher/libpathwatcher.flagTables: a table containing a list of tables denoting how each corresponding file in paths has changed, each containing boolean values indicating which types of events occurred The possible keys are: * mustScanSubDirs * userDropped * kernelDropped * eventIdsWrapped * historyDone * rootChanged * mount * unmount * itemCreated * itemRemoved * itemInodeMetaMod * itemRenamed * itemModified * itemFinderInfoMod * itemChangeOwner * itemXattrMod * itemIsFile * itemIsDir * itemIsSymlink * ownEvent (OS X 10.9+) * itemIsHardlink (OS X 10.10+) * itemIsLastHardlink (OS X 10.10+).paths: a table containing a list of file paths that have changed.fn - A function to be called when changes are detected.path - A string containing the path to be watched.Methods - API calls which can only be made on an object returned by a constructorĪPI Documentation Constructors new Signature.Constructors - API calls which return an object, typically one that offers API methods.
#PATHWATCHER HAMMERSPOON CODE#
This module is based primarily on code from the previous incarnation of Mjolnir by Steven Degutis. This simple example watches your Hammerspoon directory for changes, and when it sees a change, reloads your configs: local myWatcher = hs.pathwatcher.new(os.getenv("HOME"). timer.Hammerspoon docs: hs.pathwatcher docs » hs.pathwatcher If (current_clipboard = nil and honor_clearcontent) then

#PATHWATCHER HAMMERSPOON PASSWORD#
It prevents the history from keeping items removed by password managers
#PATHWATCHER HAMMERSPOON UPDATE#
If the pasteboard owner has changed, we add the current item to our history and update the counter.Ĭurrent_clipboard = pasteboard. changeCount() - displays how many times the pasteboard owner has changed // Indicates a new copy has been made Local settings = require( "hs.settings "). Local pasteboard = require( "hs.pasteboard "). Jumpcut: setTooltip( "Jumpcut replacement ") Local pasteOnSelect = false - Auto-type on click If any application clears the pasteboard, we also remove it from the history Local honor_clearcontent = false -asmagill request. Copies larger than this will have their label truncated and end with "…" (unicode for elipsis. Local label_length = 40 - How wide (in characters) the dropdown menu should be. Local hist_size = 20 - How many items to keep on history If you check too frequently, you will loose performance, if you check sparsely you will loose copies Local frequency = 0.8 - Speed in seconds to check for clipboard changes. > Ng irc suggestion: hs.t("jumpCutReplacementHistory", clipboard_history) I copied an example from called " Fancy configuration reloading", show below, into my a file in directory /.hammerspoon/ function reloadConfig(files) doReload fal. "typed" instead of copied to the active clipboard. This means that the selected item will be If you open the menu while pressing option/alt, you will enter the Direct Paste Mode. You can access this history on the menu (Unicode scissors icon).Ĭlicking on any item will add it to your transfer area. It monitors the clipboard/pasteboard for changes, and stores the strings you copy to the transfer area.

This is my attempt to implement a jumpcut replacement in Lua/Hammerspoon. apps, 'space ', openApplication( 'Slack ')) ctrl, 'space ', openApplication( 'iTerm ')) alt, 'space ', openApplication( "Finder ")) apps, ', ', openApplication( "System Preferences ")) apps, 'S ', openApplication( "Spotify ")) To review, open the file in an editor that reveals hidden Unicode characters. mash, "right ", setWindow( 0.5, 0, 0.5, 1)) Explanation of using hammerspoon to watch for configuration changes Raw hammerspoon-cool.txt This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. Any changes made here are automatically reloaded on save. pathwatcher Watch paths recursively for changes This simple example watches your Hammerspoon directory for changes, and when it sees a change, reloads your.
