From ac66f0df2bec39e0a075fdcc72c5c5636a6fb319 Mon Sep 17 00:00:00 2001 From: Mitchell Riedstra Date: Tue, 26 Oct 2021 08:10:33 -0400 Subject: Add ddmenu, and updated snipmenu --- bin/snipmenu | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'bin/snipmenu') diff --git a/bin/snipmenu b/bin/snipmenu index c77e6ca..bd54f7d 100755 --- a/bin/snipmenu +++ b/bin/snipmenu @@ -1,7 +1,19 @@ #!/bin/sh set -e -conf="__REPLACE__" -cd "$conf" +snipdir="__REPLACE__" +act='type' + +while [ $# -gt 0 ] ; do case $1 in + -s) snipdir="$2"; shift ; shift ;; + copy) act='copy' ; shift ;; + type) act='type' ; shift ;; + *) break ;; +esac ; done + +cd "$snipdir" _file=$(find -L . \! -type d | dmenu "$@") -xdotool type --delay 1ms --clearmodifiers --file "$conf/$_file" +case $act in +copy) xclip -selection clipboard < "$_file" ;; +type) xdotool type --delay 1ms --clearmodifiers --file "$_file" ;; +esac -- cgit v1.2.3