diff --git a/.scripts/bw-unlock b/.scripts/bw-unlock index bae7379..242ea7a 100755 --- a/.scripts/bw-unlock +++ b/.scripts/bw-unlock @@ -1,7 +1,7 @@ #!/bin/bash ## -# Depends: zenity +# Depends: zenity, bw (bitwarden-cli), notify-send # # Generates bw session key and saves it in tmp file where only current user has permissions # @@ -19,4 +19,6 @@ touch $loc -f chmod 600 $loc -echo "$session" > /tmp/bw-session \ No newline at end of file +echo "$session" > /tmp/bw-session + +notify-send "Your bitwarden vault has been unlocked until next reboot." \ No newline at end of file diff --git a/.scripts/passwords b/.scripts/passwords index 91a1179..d943d7f 100755 --- a/.scripts/passwords +++ b/.scripts/passwords @@ -21,6 +21,11 @@ options=$(echo "$items" | jq ".[].name" | sed 's/"//g') entry=$(echo "$options" | dmenu -i -p "Which entry?" $1) +if [ -z $entry ] +then + exit 0 +fi + if ! password=$(bw get password "$entry" --session "$session") then @@ -31,6 +36,11 @@ then user=$(echo "$user_options" | jq '.[].login.username' | dmenu -i -p "Which account?" $1 | sed 's/"//g') + if [ -z $user ] + then + exit 0; + fi + pass=$(echo "$user_options" | jq '.[] | select(.login.username == "'"$user"'") | .login.password' | sed 's/"//g') echo "$pass" | xclip -sel clip @@ -38,3 +48,5 @@ then else echo "$password" | xclip -sel clip fi + +notify-send "password for $entry probably copied to clipbroad" diff --git a/.xinitrc b/.xinitrc index 4f810a1..1db986b 100644 --- a/.xinitrc +++ b/.xinitrc @@ -48,5 +48,6 @@ if [ "$HOST" == "archmetabox" ] ; then fi # start my trusty window manager -# exec xmonad +exec xmonad --recompile +exec xmonad