diff options
| author | Mitchell Riedstra <mitch@riedstra.dev> | 2021-10-26 08:10:33 -0400 |
|---|---|---|
| committer | Mitchell Riedstra <mitch@riedstra.dev> | 2021-10-26 08:10:33 -0400 |
| commit | ac66f0df2bec39e0a075fdcc72c5c5636a6fb319 (patch) | |
| tree | 0427b23208241d85e22d71cf5d98f8db07736814 /bin/snipmenu | |
| parent | cc99124e7a063934a0b9a1441ae41277fa30c4b6 (diff) | |
| download | dotfiles-ac66f0df2bec39e0a075fdcc72c5c5636a6fb319.tar.gz dotfiles-ac66f0df2bec39e0a075fdcc72c5c5636a6fb319.tar.xz | |
Add ddmenu, and updated snipmenu
Diffstat (limited to 'bin/snipmenu')
| -rwxr-xr-x | bin/snipmenu | 18 |
1 files changed, 15 insertions, 3 deletions
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 |
