Skip to content

Commit

Permalink
feat(fish): script mimicking xsel deferring to pbcopy/pbpaste
Browse files Browse the repository at this point in the history
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
  • Loading branch information
caarlos0 committed Apr 3, 2024
1 parent d169569 commit c7f7e13
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
2 changes: 0 additions & 2 deletions pkgs/bins/bin/pbcopy
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,4 @@ if test -n "$SSH_TTY"; then
nc -c -w1 localhost 2224
elif test "$(uname)" = Darwin; then
/usr/bin/pbcopy
else
xsel --clipboard --input
fi
2 changes: 0 additions & 2 deletions pkgs/bins/bin/pbpaste
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,4 @@ if test -n "$SSH_TTY"; then
nc -w1 -c localhost 2225
elif test "$(uname)" = Darwin; then
/usr/bin/pbpaste
else
xsel --clipboard --output
fi
10 changes: 10 additions & 0 deletions pkgs/bins/bin/xsel
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/env bash
set -eo pipefail
for i in "$@"; do
if test "$i" = "--input"; then
pbcopy
fi
if test "$i" = "--output"; then
pbpaste
fi
done

0 comments on commit c7f7e13

Please sign in to comment.