commit 1c343eb5a66f3cbfd0bf05408b72c1072267d3f5 parent 4909eab1ae4ad3da5b53356ac54fd2dbfbbe659f Author: Vincent Demeester <vincent@sbr.pm> Date: Tue, 23 Aug 2022 18:25:45 +0200 nix/packages: update pbcopy/pbpaste for sway Signed-off-by: Vincent Demeester <vincent@sbr.pm> Diffstat:
M | nix/packages/my/scripts/bin/pbcopy | | | 8 | ++++++-- |
M | nix/packages/my/scripts/bin/pbpaste | | | 6 | +++++- |
2 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/nix/packages/my/scripts/bin/pbcopy b/nix/packages/my/scripts/bin/pbcopy @@ -1,7 +1,11 @@ #!/usr/bin/env bash set -e if [ ! $(uname -s) = "Darwin" ]; then - xsel --clipboard --input $@ + if ! command -v wl-copy &> /dev/null; then + wl-copy $@ + else + xsel --clipboard --input $@ + fi else - pbpaste $@ + pbcopy $@ fi diff --git a/nix/packages/my/scripts/bin/pbpaste b/nix/packages/my/scripts/bin/pbpaste @@ -1,7 +1,11 @@ #!/usr/bin/env bash set -e if [ ! $(uname -s) = "Darwin" ]; then - xsel --clipboard --output $@ + if ! command -v wl-paste &> /dev/null; then + wl-paste $@ + else + xsel --clipboard --output $@ + fi else pbpaste $@ fi