From 82d07da3add2393c53d20e41e8aba383f058858f Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Sat, 1 Jun 2024 13:32:36 +0200 Subject: checkpoint --- bin/menuscripts/mpass | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100755 bin/menuscripts/mpass (limited to 'bin/menuscripts/mpass') diff --git a/bin/menuscripts/mpass b/bin/menuscripts/mpass new file mode 100755 index 0000000..7029ffe --- /dev/null +++ b/bin/menuscripts/mpass @@ -0,0 +1,27 @@ +#!/usr/bin/env sh +store="${PASSWORD_STORE_DIR:-$HOME/.password-store}" + +# list passwords, group directories first +list_pswds() +{ + find "$1" \ + -maxdepth 1 -mindepth 1 \ + -not -name '.*' -type d -printf "%y\t%f\n" -o \ + -not -name '.*' -not -type d -printf "%y\t%f\n" | + sort -k1 -k2 | + cut -f 2 | sed 's/\.gpg$//' +} + +while [ -d "$store/$file" ] +do + choice="$(list_pswds "$store/$file" | commander -c)" + [ "$choice" ] || exit 1 + [ -z "$file" ] && file="$choice" || file="$file/$choice" +done +[ "$file" ] || exit 1 + +pass show -c "$file" || exit 1 +notify-send -t 1000 "mpass" "copied $file" + +[ "$WAYLAND_DISPLAY" ] && cliphist list >/dev/null && # on wayland and cliphist is running + cliphist list | head -n 1 | cliphist delete -- cgit v1.2.3 From d2c9d33ad179c766c33b5c5829081d7ec9d931a4 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Thu, 6 Jun 2024 14:29:46 +0200 Subject: checkpoint --- bin/menuscripts/mpass | 4 ++-- config/home/.zshenv | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'bin/menuscripts/mpass') diff --git a/bin/menuscripts/mpass b/bin/menuscripts/mpass index 7029ffe..7348321 100755 --- a/bin/menuscripts/mpass +++ b/bin/menuscripts/mpass @@ -14,14 +14,14 @@ list_pswds() while [ -d "$store/$file" ] do - choice="$(list_pswds "$store/$file" | commander -c)" + choice="$(list_pswds "$store/$file" | dmenu -c -g 4 -l 4)" [ "$choice" ] || exit 1 [ -z "$file" ] && file="$choice" || file="$file/$choice" done [ "$file" ] || exit 1 pass show -c "$file" || exit 1 -notify-send -t 1000 "mpass" "copied $file" +notify-send -t 1000 "mpass" "copied: $file" [ "$WAYLAND_DISPLAY" ] && cliphist list >/dev/null && # on wayland and cliphist is running cliphist list | head -n 1 | cliphist delete diff --git a/config/home/.zshenv b/config/home/.zshenv index f302a10..5a3df90 100644 --- a/config/home/.zshenv +++ b/config/home/.zshenv @@ -93,3 +93,6 @@ export PATH="$XDG_CONFIG_HOME/cargo/bin:$PATH" export PATH="$PATH:./node_modules/.bin" export PATH="$PATH:$HOME/.dotnet/tools" export PATH="$PATH:$GOPATH/bin" + +export PLAN9=/usr/lib/plan9 +export PATH="$PATH:$PLAN9/bin" -- cgit v1.2.3