diff --git a/dotfiles/fish/alias.fish b/dotfiles/fish/alias.fish index 7f00cc3..ce531d2 100644 --- a/dotfiles/fish/alias.fish +++ b/dotfiles/fish/alias.fish @@ -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 ################################################################