m/fzf
1
0
mirror of https://github.com/junegunn/fzf.git synced 2025-11-19 00:53:42 -05:00

Add key binding to yank current entry to clipboard in Wayland.

Matthias Braun
2020-12-01 17:20:34 +01:00
parent 3272eb7201
commit f17108a2d5

@@ -57,6 +57,7 @@ Table of Contents
* [dotfiles management](#dotfiles-management)
* [Transmission](#transmission)
* [Pacman](#pacman)
* [Copy current item to clipboard](#clipboard)
### General
@@ -1656,3 +1657,13 @@ function re() {
yay -Qq | fzf -q "$1" -m --preview 'yay -Qi {1}' | xargs -ro yay -Rns
}
```
### Clipboard
Uses [wl-copy](https://github.com/bugaevc/wl-clipboard) to copy the current entry to the clipboard on Wayland:
```sh
export FZF_DEFAULT_OPTS='--bind "ctrl-y:execute-silent(printf {} | cut -f 2- | wl-copy --trim-newline)"'
```
This works with `execute-silent` but not with `execute`, presumably because `execute` waits for `wl-copy` to end. Appending a `&` did not change that.