template pass script

Amolith created

Change summary

dot_config/rofi/executable_pass.sh      |  3 ---
dot_config/rofi/executable_pass.sh.tmpl | 21 +++++++++++++++++++++
2 files changed, 21 insertions(+), 3 deletions(-)

Detailed changes

dot_config/rofi/executable_pass.sh.tmpl 🔗

@@ -0,0 +1,21 @@
+#!/bin/sh
+
+export BW_SESSION="{{ .bw_session }}"
+
+ENTRY=$(rofi -dmenu -password -p "󰟵 ")
+
+if [ -z "$ENTRY" ]; then
+    exit
+fi
+
+echo "$ENTRY"
+
+PASSWD=$(bw get password "$ENTRY")
+
+if [ -z "$PASSWD" ]; then
+    notify-send "There was an error getting the password"
+    exit
+fi
+
+xdotool type --delay 100 "$PASSWD"
+xdotool key enter