aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorMitchell Riedstra <mitch@riedstra.dev>2021-10-26 08:10:33 -0400
committerMitchell Riedstra <mitch@riedstra.dev>2021-10-26 08:10:33 -0400
commitac66f0df2bec39e0a075fdcc72c5c5636a6fb319 (patch)
tree0427b23208241d85e22d71cf5d98f8db07736814 /bin
parentcc99124e7a063934a0b9a1441ae41277fa30c4b6 (diff)
downloaddotfiles-ac66f0df2bec39e0a075fdcc72c5c5636a6fb319.tar.gz
dotfiles-ac66f0df2bec39e0a075fdcc72c5c5636a6fb319.tar.xz
Add ddmenu, and updated snipmenu
Diffstat (limited to 'bin')
-rw-r--r--bin/Makefile3
-rwxr-xr-xbin/ddmenu20
-rwxr-xr-xbin/passmenu26
-rwxr-xr-xbin/snipmenu18
4 files changed, 36 insertions, 31 deletions
diff --git a/bin/Makefile b/bin/Makefile
index ea174e3..dc416a9 100644
--- a/bin/Makefile
+++ b/bin/Makefile
@@ -6,11 +6,10 @@ linux:
install:
install -d $(HOME)/bin
- install snipmenu $(HOME)/bin/
sed "s|__REPLACE__|$$(dirname `pwd`)/snips|g" < snipmenu > $(HOME)/bin/snipmenu
chmod +x $(HOME)/bin/snipmenu
- install passmenu $(HOME)/bin/
install day $(HOME)/bin/
+ install ddmenu $(HOME)/bin/
install night $(HOME)/bin/
install wallpaper $(HOME)/bin/
install status-bar $(HOME)/bin/
diff --git a/bin/ddmenu b/bin/ddmenu
new file mode 100755
index 0000000..b4c1bc6
--- /dev/null
+++ b/bin/ddmenu
@@ -0,0 +1,20 @@
+#!/bin/sh
+# dmenu for dmenus
+command="$(dmenu "$@" <<EOF
+pass
+pass-type
+otp
+otp-type
+snip
+snip-type
+EOF
+)"
+
+case $command in
+ pass) dpw-menu "$@" ;;
+ pass-type) dpw-menu --type "$@" ;;
+ otp) dpw-menu --otp "$@" ;;
+ otp-type) dpw-menu --otp --type "$@" ;;
+ snip) snipmenu copy "$@" ;;
+ snip-type) snipmenu "$@" ;;
+esac
diff --git a/bin/passmenu b/bin/passmenu
deleted file mode 100755
index 4f4ef1d..0000000
--- a/bin/passmenu
+++ /dev/null
@@ -1,26 +0,0 @@
-#!/usr/bin/env bash
-
-shopt -s nullglob globstar
-
-typeit=0
-if [[ $1 == "--type" ]]; then
- typeit=1
- shift
-fi
-
-prefix=${PASSWORD_STORE_DIR-~/.password-store}
-password_files=( "$prefix"/**/*.gpg )
-password_files=( "${password_files[@]#"$prefix"/}" )
-password_files=( "${password_files[@]%.gpg}" )
-
-password=$(printf '%s\n' "${password_files[@]}" | dmenu "$@")
-
-[[ -n $password ]] || exit
-
-if [[ $typeit -eq 0 ]]; then
- pass show -c "$password" 2>/dev/null
-else
- pass show "$password" | { IFS= read -r pass; printf %s "$pass"; } |
- xdotool type --clearmodifiers --file -
-fi
-
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