24 lines
487 B
Bash
Executable File
24 lines
487 B
Bash
Executable File
#!/bin/bash
|
|
|
|
##
|
|
# Depends: zenity, bw (bitwarden-cli), notify-send
|
|
#
|
|
# Generates bw session key and saves it in tmp file where only current user has permissions
|
|
#
|
|
# By Solomon Laing (solomonlaing@pm.me)
|
|
# Date 2020-03-26
|
|
##
|
|
|
|
password=$(zenity --password)
|
|
|
|
session=$(bw unlock "$password" | awk 'NF{last=$NF} END{print last}')
|
|
|
|
loc="/tmp/bw-session"
|
|
|
|
touch $loc -f
|
|
|
|
chmod 600 $loc
|
|
|
|
echo "$session" > /tmp/bw-session
|
|
|
|
notify-send "Your bitwarden vault has been unlocked until next reboot." |