tSend doi to primary and clipboard selection in two different formats - scholar… | |
git clone git://src.adamsgaard.dk/scholarref | |
Log | |
Files | |
Refs | |
README | |
LICENSE | |
--- | |
commit 344cb74ecf5cb2e2b5f25f25e8d303143b1371f4 | |
parent ba0f9ec17aeb1c31906ce0fcb206404fe7b60d5d | |
Author: Anders Damsgaard <[email protected]> | |
Date: Mon, 6 Jul 2020 10:31:18 +0200 | |
Send doi to primary and clipboard selection in two different formats | |
Diffstat: | |
M getdoi | 3 ++- | |
1 file changed, 2 insertions(+), 1 deletion(-) | |
--- | |
diff --git a/getdoi b/getdoi | |
t@@ -83,7 +83,8 @@ get_doi() { | |
fi | |
fi | |
echo "$doi" | |
- [ "$clip" = 1 ] && echo "https://doi.org/${doi}" | \ | |
+ [ "$clip" = 1 ] && printf '%s' "${doi}" | xclip | |
+ [ "$clip" = 1 ] && printf 'https://doi.org/%s' "${doi}" | \ | |
xclip -selection clipboard | |
[ "$notify" = 1 ] && notify-send "$doi" | |
[ "$open" = 1 ] && browser_open "https://doi.org/${doi}" |