Merged X11 and wayland version of rofi-pass-simple.sh

This commit is contained in:
Thomas Kolb 2021-07-16 21:59:56 +02:00
parent 14d6b46843
commit ed13e8cf9f
2 changed files with 7 additions and 15 deletions

View file

@ -1,14 +0,0 @@
#!/bin/sh
if [ ! -z "$PASSWORD_STORE_DIR" ]; then
cd "$PASSWORD_STORE_DIR"
else
cd "$HOME/.password-store"
fi
if [ -z $@ ]; then
find -name \*.gpg | sed 's/\.\/\(.*\)\.gpg/\1/'
else
#nohup pass show -c "$@" >/dev/null &
nohup sh -c "pass show \"$@\" | head -n 1 | wl-copy --trim-newline" >/dev/null &
fi

View file

@ -9,5 +9,11 @@ fi
if [ -z $@ ]; then
find -name \*.gpg | sed 's/\.\/\(.*\)\.gpg/\1/'
else
if [ -z "$WAYLAND_DISPLAY" ]; then
# X11 version
nohup pass show -c "$@" >/dev/null &
else
# Wlroots (sway) version
nohup sh -c "pass show \"$@\" | head -n 1 | wl-copy --trim-newline" >/dev/null &
fi
fi