[bin] Change snippet lookup path
This commit is contained in:
parent
7bba348a1f
commit
9b3f492494
|
@ -1,8 +1,7 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
set -eo pipefail
|
set -eo pipefail
|
||||||
|
SNIPPET_DIR=~/.local/share/snippets
|
||||||
SNIPPET_DIR=~/.local/snippets
|
|
||||||
|
|
||||||
if [[ "$1" == "--preview" ]]; then
|
if [[ "$1" == "--preview" ]]; then
|
||||||
bat --theme="OneHalfDark" --style=numbers,changes --color always "$SNIPPET_DIR/$2"
|
bat --theme="OneHalfDark" --style=numbers,changes --color always "$SNIPPET_DIR/$2"
|
||||||
|
@ -10,4 +9,5 @@ if [[ "$1" == "--preview" ]]; then
|
||||||
fi;
|
fi;
|
||||||
|
|
||||||
SNIPPET=$(find $SNIPPET_DIR -type f -printf "%f\n"| fzf --preview-window="bottom" --preview="$0 --preview {}")
|
SNIPPET=$(find $SNIPPET_DIR -type f -printf "%f\n"| fzf --preview-window="bottom" --preview="$0 --preview {}")
|
||||||
cat "${SNIPPET_DIR}/${SNIPPET}" | wl-copy
|
cat "${SNIPPET_DIR}/${SNIPPET}" | wl-copy --primary
|
||||||
|
notify-send "Copied ${SNIPPET}"
|
||||||
|
|
Loading…
Reference in New Issue