Middle-click paste menu for text snippets
This commit is contained in:
parent
ccf6a8e85b
commit
c99674cae7
|
@ -0,0 +1,12 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
# Copy snippet to primary clipboard for middle-click pasting
|
||||||
|
|
||||||
|
# Maintain list of snippets in private repository
|
||||||
|
FOLDER=${HOME}/.private-scripts/snippets
|
||||||
|
|
||||||
|
FILE=`ls ${FOLDER} | /usr/bin/rofi -dmenu`
|
||||||
|
|
||||||
|
if [ -f ${FOLDER}/${FILE} ]; then
|
||||||
|
DATA=$([ -x "${FOLDER}/${FILE}" ] && bash "${FOLDER}/${FILE}" || head --bytes=-1 ${FOLDER}/${FILE})
|
||||||
|
printf -- "${DATA}" | wl-copy -p
|
||||||
|
fi
|
Loading…
Reference in New Issue