sentriz / cliphist

wayland clipboard manager with support for multimedia
GNU General Public License v3.0
719 stars 22 forks source link

How to play notification sound for succesfull copy? #78

Closed azzamsa closed 10 months ago

azzamsa commented 10 months ago

Hi,

I need visual/audio feedback for a successful copy.

In Pano it is supported by default. In CopyQ I use this script:

copyq:
if ( isClipboard() )
  execute('pw-play', '/home/azzamsa/sounds/slick.ogg')

Is this possible with a cliphist? Any scripting idea?

Thank you for cilphist! :ice_cream:

azzamsa commented 10 months ago

Found the solution.

bind = Super, Y, exec, ~/opt/bin/nwlcopy #Y-ank
#!/bin/fish

set selection (cliphist list | fuzzel --dmenu | cliphist decode)

if test "$selection" != ""
    echo "$selection" | wl-copy
end
 wl-paste --watch cliphist store
 wl-paste --watch pw-play ~/sounds/hum.ogg

Credits: https://github.com/bugaevc/wl-clipboard/issues/164#issuecomment-1476434865