fish: add wl-copy file alias

This commit is contained in:
lelgenio 2021-06-02 20:36:53 -03:00
parent d50f18814b
commit 570d4af7eb
1 changed files with 22 additions and 0 deletions

View File

@ -107,6 +107,28 @@ function open -w xdg-open
end
################################################################
# Copy files like graphical programs
################################################################
function wl-copy-f -w wl-copy
set -a file
for arg in (seq 1 (count $argv))
if test -f "$argv[$arg]"
set -a file (realpath $argv[$arg])
set -e argv[$arg]
end
end
if test -n "$file"
wl-copy $argv -t text/uri-list "file:///$file"
else
wl-copy $argv
end
end
abbr -g wcf 'wl-copy-f'
################################################################
# man
################################################################