commit 7d24c313cd9dfc72fc2ca1d73a8451f3a447a189 parent 9cd2cad9e62f732822be2841f9968ca99fa5db30 Author: Janis Pagel <janis.pagel@ims.uni-stuttgart.de> Date: Tue, 10 Nov 2020 15:57:22 +0100 Add script to handle snippets Diffstat:
A | bin/.local/bin/snippy | | | 10 | ++++++++++ |
A | snippets/.local/share/snippets/date | | | 3 | +++ |
A | snippets/.local/share/snippets/website | | | 1 | + |
3 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/bin/.local/bin/snippy b/bin/.local/bin/snippy @@ -0,0 +1,10 @@ +#!/bin/sh + +SNIPS=${XDG_DATA_HOME}/snippets +FILE=`ls ${SNIPS} | dmenu -c -l 30` +if [ -f ${SNIPS}/${FILE} ]; then + DATA=$([ -x "${SNIPS}/${FILE}" ] && ${SHELL} "${SNIPS}/${FILE}" || head --bytes=-1 ${SNIPS}/${FILE}) + printf "$DATA" | xsel -p -i + printf "$DATA" | xsel -b -i + xdotool key shift+Insert +fi diff --git a/snippets/.local/share/snippets/date b/snippets/.local/share/snippets/date @@ -0,0 +1,3 @@ +#!/bin/sh + +printf "$(date)" diff --git a/snippets/.local/share/snippets/website b/snippets/.local/share/snippets/website @@ -0,0 +1 @@ +https://janispagel.de