Switch to fish shell
This commit is contained in:
20
.config/fish/functions/clip.fish
Normal file
20
.config/fish/functions/clip.fish
Normal file
@@ -0,0 +1,20 @@
|
||||
function clip
|
||||
set -g stdin
|
||||
if not tty -s >/dev/null
|
||||
read stdin
|
||||
end
|
||||
set stdin $(string trim -- $stdin)
|
||||
|
||||
set -l argv $(string trim -- $argv)
|
||||
if test -n "$argv"
|
||||
echo "$argv" | xclip -selection clipboard
|
||||
return 0
|
||||
end
|
||||
|
||||
if test -n "$stdin"
|
||||
echo "$stdin" | xclip -selection clipboard
|
||||
return 0
|
||||
end
|
||||
|
||||
xclip -selection clipboard -o
|
||||
end
|
||||
Reference in New Issue
Block a user