Add support for wayland copy/paste

This commit is contained in:
Sean Molenaar 2018-12-30 22:51:24 +01:00 committed by Fabian Homborg
parent 7191a42ca0
commit 41b3331175
3 changed files with 5 additions and 0 deletions

View file

@ -12,6 +12,7 @@
- Added completions for: - Added completions for:
- nothing yet... - nothing yet...
- Lots of improvements to completions. - Lots of improvements to completions.
- fish_clipboard_* now supports wayland by means of [wl-clipboard](https://github.com/bugaevc/wl-clipboard).
--- ---

View file

@ -10,5 +10,7 @@ function fish_clipboard_copy
printf '%s\n' $cmdline | xsel --clipboard 2>/dev/null printf '%s\n' $cmdline | xsel --clipboard 2>/dev/null
else if type -q xclip else if type -q xclip
printf '%s\n' $cmdline | xclip -selection clipboard 2>/dev/null printf '%s\n' $cmdline | xclip -selection clipboard 2>/dev/null
else if type -q wl-copy
printf '%s\n' $cmdline | wl-copy
end end
end end

View file

@ -13,6 +13,8 @@ function fish_clipboard_paste
if not set data (xclip -selection clipboard -o 2>/dev/null) if not set data (xclip -selection clipboard -o 2>/dev/null)
return 1 return 1
end end
else if type -q wl-paste
set data (wl-paste)
end end
# Also split on \r to turn it into a newline, # Also split on \r to turn it into a newline,
# otherwise the output looks really confusing. # otherwise the output looks really confusing.