diff options
author | June McEnroe <june@causal.agency> | 2021-02-09 17:40:41 -0500 |
---|---|---|
committer | June McEnroe <june@causal.agency> | 2021-02-09 17:40:41 -0500 |
commit | d3aa4117f6210bb30dd6d17b42bdb40e3c5399d0 (patch) | |
tree | 209efd428c68fee383174ff35a016e1930249306 /home/.local/bin/open | |
parent | Use flags for pbd client behaviour (diff) | |
download | src-d3aa4117f6210bb30dd6d17b42bdb40e3c5399d0.tar.gz src-d3aa4117f6210bb30dd6d17b42bdb40e3c5399d0.zip |
Add pbcopy, pbpaste, open dispatch scripts
Diffstat (limited to 'home/.local/bin/open')
-rwxr-xr-x | home/.local/bin/open | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/home/.local/bin/open b/home/.local/bin/open new file mode 100755 index 00000000..256a62e2 --- /dev/null +++ b/home/.local/bin/open @@ -0,0 +1,18 @@ +#!/bin/sh +set -eu + +if [ -n "${SSH_CLIENT:-}" ]; then + exec pbd -o "$@" +fi + +case "$1" in + (*.gif|*.jpeg|*.jpg|*.png) + curl -LSs "$1" | imv - + ;; + (*.txt) + exec xterm -hold -e sh -c 'curl -LSs "$1" | $PAGER' - "$1" + ;; + (*) + printf '%s' "$1" | pbcopy + ;; +esac |