shownotes-w3m-rice/fzf_nova/_greenclip

14 lines
522 B
Bash
Executable File

#!/usr/bin/env bash
# AUTHOR: gotbletu (@gmail|twitter|youtube|github|lbry)
# https://www.youtube.com/user/gotbletu
# DESC: copy from your clipboard history
# DEMO: https://www.youtube.com/watch?v=Vzt0tVNrJ0A
# DEPEND: fzf greenclip coreutils xsel (or tmux)
# REFF: https://github.com/erebe/greenclip
# NOTE: not good with multiline at the moment
selected="$(greenclip print | fzf -e -i --reverse)"
[ -z "$selected" ] && exit
printf "%s" "$selected" | xsel -b
printf "%s" "$selected" | tmux load-buffer -