Skip to content

dangh/pbmonitor.fish

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 

Repository files navigation

pbmonitor.fish

Installation

brew install dangh/formulae/pbmonitor
fisher install dangh/pbmonitor.fish

Usage

Put your monitoring function in ~/.config/fish/conf.d/ so it can autoload when fish started.

function my-monitor --on-event clipboard_change --argument-names content
  echo clipboard changed: $content
end

Limitation

Fish events are not cross-process which mean your functions in other processes other than the background one spawned by this plugin will not be notified. A possible workaround is storing the clipboard content in the universal scope, and watching for that variable.

# ~/.config/fish/conf.d/clipboard-broadcast.fish
function clipboard-broadcast --on-event clipboard_change --argument-names content
  set -U clipboard_do_not_read_xxx $content
end

# in other places, eg ~/.config/fish/functions/clipboard-listener.fish
function clipboard-listener --on-variable clipboard_do_not_read_xxx
  # process
end

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages