From ed13e8cf9f4f5b1ebc405485674e7837c288d528 Mon Sep 17 00:00:00 2001 From: Thomas Kolb Date: Fri, 16 Jul 2021 21:59:56 +0200 Subject: [PATCH] Merged X11 and wayland version of rofi-pass-simple.sh --- scripts/rofi-pass-simple-wlr.sh | 14 -------------- scripts/rofi-pass-simple.sh | 8 +++++++- 2 files changed, 7 insertions(+), 15 deletions(-) delete mode 100755 scripts/rofi-pass-simple-wlr.sh diff --git a/scripts/rofi-pass-simple-wlr.sh b/scripts/rofi-pass-simple-wlr.sh deleted file mode 100755 index dae91cc..0000000 --- a/scripts/rofi-pass-simple-wlr.sh +++ /dev/null @@ -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 diff --git a/scripts/rofi-pass-simple.sh b/scripts/rofi-pass-simple.sh index 665c5c1..180dcd6 100755 --- a/scripts/rofi-pass-simple.sh +++ b/scripts/rofi-pass-simple.sh @@ -9,5 +9,11 @@ fi if [ -z $@ ]; then find -name \*.gpg | sed 's/\.\/\(.*\)\.gpg/\1/' else - nohup pass show -c "$@" >/dev/null & + 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