Skip to content

Commit

Permalink
Fix copy and paste on Wayland systems
Browse files Browse the repository at this point in the history
  • Loading branch information
justbispo authored and daleeidd committed Jan 22, 2024
1 parent fd3a1fd commit 4aa609e
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions functions/_natural_selection.fish
Original file line number Diff line number Diff line change
Expand Up @@ -58,16 +58,28 @@ function _natural_selection --description 'Input wrapper to improve selection'
else if test $input_function = "copy-to-clipboard"
# Do not copy empty selection. Allows application native copy to work.
if _natural_selection_is_selecting
_natural_selection_get_selection | pbcopy
if type -q wl-copy
_natural_selection_get_selection | wl-copy
else
_natural_selection_get_selection | pbcopy
end
end
else if test $input_function = "cut-to-clipboard"
# Do not cut empty selection.
if _natural_selection_is_selecting
_natural_selection_get_selection | pbcopy
if type -q wl-copy
_natural_selection_get_selection | wl-copy
else
_natural_selection_get_selection | pbcopy
end
_natural_selection_kill_selection
end
else if test $input_function = "paste-from-clipboard"
_natural_selection_replace_selection -- (pbpaste)
if type -q wl-paste
_natural_selection_replace_selection -- (wl-paste)
else
_natural_selection_replace_selection -- (pbpaste)
end
else
if test -n "$_flag_is_selecting"
_natural_selection_begin_selection
Expand Down

0 comments on commit 4aa609e

Please sign in to comment.