This commit is contained in:
BarbUk 2017-11-07 23:41:07 +04:00
parent e3b06105a7
commit de2dd6faf9

8
snippy
View File

@ -41,10 +41,8 @@
# CLIPASTE="xdotool key ctrl+shift+v" # CLIPASTE="xdotool key ctrl+shift+v"
DIR=${HOME}/.snippy DIR=${HOME}/.snippy
MENU_ENGINE="dmenu" MENU_ENGINE="rofi"
# shellcheck disable=SC1090 DMENU_ARGS='-dmenu -i -sort'
. "$HOME/.dmenurc"
DMENU_ARGS="$DMENU_CONF -l 10 -p Snippets:"
# if nothing happens, try "xdotool click 2", "xdotool key ctrl+v" or "xdotool key ctrl+shift+v" # if nothing happens, try "xdotool click 2", "xdotool key ctrl+v" or "xdotool key ctrl+shift+v"
GUIPASTE="xdotool key ctrl+v" GUIPASTE="xdotool key ctrl+v"
CLIPASTE="xdotool key ctrl+shift+v" CLIPASTE="xdotool key ctrl+shift+v"
@ -71,7 +69,7 @@ run(){
# Use the filenames in the snippy directory as menu entries. # Use the filenames in the snippy directory as menu entries.
# Get the menu selection from the user. # Get the menu selection from the user.
# shellcheck disable=SC2086 # shellcheck disable=SC2086
FILE=$(find -L . -type f | grep -v '^\.$' | sed 's!\.\/!!' | grep -vE '\.git/|\.gitconfig|\.gitkeep' | ${MENU_ENGINE} ${MENU_ARGS}) FILE=$(find -L . -type f | grep -v '^\.$' | sed 's!\.\/!!' | grep -vE '\.git/|\.gitconfig|\.gitkeep' | ${MENU_ENGINE} ${MENU_ARGS} -p ' ')
# just return if nothing was selected # just return if nothing was selected
[[ -z "${FILE}" ]] && return 1 [[ -z "${FILE}" ]] && return 1