fix: clipboard
This commit is contained in:
parent
171d49c5bb
commit
ce5fd8b332
1 changed files with 17 additions and 15 deletions
|
|
@ -26,8 +26,10 @@
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
preview() {
|
preview() {
|
||||||
|
ID=$(awk '{print $1}' <<< "$1")
|
||||||
|
|
||||||
TMP=$(mktemp)
|
TMP=$(mktemp)
|
||||||
cliphist decode "$1" > "$TMP" 2>/dev/null || {
|
cliphist decode "$ID" > "$TMP" 2>/dev/null || {
|
||||||
echo "Failed to decode"
|
echo "Failed to decode"
|
||||||
rm -f "$TMP"
|
rm -f "$TMP"
|
||||||
return
|
return
|
||||||
|
|
@ -67,16 +69,16 @@
|
||||||
--header="$HELP" \
|
--header="$HELP" \
|
||||||
--preview 'bash -c "preview \"$1\"" _ {}' \
|
--preview 'bash -c "preview \"$1\"" _ {}' \
|
||||||
--preview-window=right:60% \
|
--preview-window=right:60% \
|
||||||
--bind 'del:execute-silent(bash -c "cliphist delete \"$1\"" _ {})+reload(cliphist list)' \
|
--bind "del:execute-silent(bash -c 'ID=$(cut -d\" \" -f1 <<< \"$1\"); cliphist delete \"$ID\"' _ {})+reload(cliphist list)" \
|
||||||
--bind 'ctrl-d:execute-silent(cliphist wipe)+reload(cliphist list)' \
|
--bind "ctrl-d:execute-silent(cliphist wipe)+reload(cliphist list)" \
|
||||||
--bind 'ctrl-y:execute-silent(bash -c "cliphist decode \"$1\" | wl-copy" _ {})' \
|
--bind "ctrl-y:execute-silent(bash -c 'ID=$(cut -d\" \" -f1 <<< \"$1\"); cliphist decode \"$ID\" | wl-copy' _ {})" \
|
||||||
--bind 'ctrl-o:execute-silent(bash -c "cliphist decode \"$1\" > /tmp/clipimg && imv /tmp/clipimg" _ {})' \
|
--bind "ctrl-o:execute-silent(bash -c 'ID=$(cut -d\" \" -f1 <<< \"$1\"); cliphist decode \"$ID\" > /tmp/clipimg && imv /tmp/clipimg' _ {})" \
|
||||||
--bind 'ctrl-i:change-preview-window(hidden)'
|
--bind "ctrl-i:change-preview-window(hidden)" )
|
||||||
)
|
|
||||||
|
|
||||||
[[ -z "$SELECTION" ]] && exit 0
|
[[ -z "$SELECTION" ]] && exit 0
|
||||||
|
|
||||||
cliphist decode <<< "$SELECTION" | wl-copy
|
ID=$(awk '{print $1}' <<< "$SELECTION")
|
||||||
|
cliphist decode "$ID" | wl-copy
|
||||||
exit 0
|
exit 0
|
||||||
done
|
done
|
||||||
'';
|
'';
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue