This repository has been archived on 2024-03-28. You can view files and clone it, but cannot push or open issues or pull requests.
dotfiles/common/bin/clip

16 lines
341 B
Plaintext
Raw Normal View History

2020-05-18 15:34:35 -05:00
#!/usr/bin/env bash
2019-12-05 16:09:52 -06:00
2020-04-21 16:38:58 -05:00
# TODO: detect MIME type?
2023-07-17 11:23:37 -05:00
# TODO: figure out how/why these programs "wait" -- can a `clip-once` script exist building on this?
# wl-copy `-o`, xclip `-l 1`?
2020-04-21 16:38:58 -05:00
2023-07-17 11:23:37 -05:00
if [ "$(uname)" == "Linux" ]; then
if is_wayland; then
wl-copy -n "$@"
else
xclip -i -sel c "$@"
fi
elif [ "$(uname)" == "Darwin" ]; then
pbcopy "$@"
2020-03-26 16:32:32 -05:00
fi