diff options
author | Joursoir <chat@joursoir.net> | 2021-01-14 19:26:56 +0000 |
---|---|---|
committer | Joursoir <chat@joursoir.net> | 2021-01-14 19:30:18 +0000 |
commit | 3165436ed14cb353843abf01e9208c088583bc40 (patch) | |
tree | 0cc5d967c94198a90402a732ca6e8842665b58fc /lpass_copy.sh | |
parent | ca3fc712cd9038c587cc897426dbadedcee0cfd0 (diff) | |
download | lock-password-3165436ed14cb353843abf01e9208c088583bc40.tar.gz lock-password-3165436ed14cb353843abf01e9208c088583bc40.tar.bz2 lock-password-3165436ed14cb353843abf01e9208c088583bc40.zip |
rewrite shell script 'copy' to c language
Diffstat (limited to 'lpass_copy.sh')
-rwxr-xr-x | lpass_copy.sh | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/lpass_copy.sh b/lpass_copy.sh deleted file mode 100755 index 9499dec..0000000 --- a/lpass_copy.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/usr/bin/env bash - -error() { - echo "$@" - exit 1 -} - -if [[ -z $1 ]]; then - error "Error: nothing to copy" -fi - -if [[ -n $WAYLAND_DISLPLAY ]]; then - command=(wl-copy) - if [[ $X_SELECTION == primary ]]; then - command+=( --primary ) - fi -elif [[ -n $DISPLAY ]]; then - command=(xclip -selection clipboard) -else - error "Error: X11 or Wayland display were not detected" -fi - -echo "$1" | "${command[@]}" || error "Error: failed to copy data to clipboard" -echo "Password copied to clipboard."
\ No newline at end of file |