identity.sh: added script
This commit is contained in:
parent
52459f36a5
commit
5045970d3b
26
src/.local/bin/identity.sh
Executable file
26
src/.local/bin/identity.sh
Executable file
@ -0,0 +1,26 @@
|
||||
#!/bin/sh
|
||||
# Sets up environment variables for things I don't want to expose in my dotfiles
|
||||
|
||||
if [ -z "$XDG_CONFIG_HOME" ]; then
|
||||
XDG_CONFIG_HOME="$HOME"/.config
|
||||
fi
|
||||
|
||||
IDFILE="$XDG_CONFIG_HOME"/identity
|
||||
|
||||
cat << "EOF" > "$IDFILE"
|
||||
#!/bin/sh
|
||||
# Environment variables for personal information
|
||||
EOF
|
||||
|
||||
fields=$(mktemp)
|
||||
cat << "EOF" > "$fields"
|
||||
export ID_REALNAME=
|
||||
export ID_EMAIL=
|
||||
EOF
|
||||
|
||||
keepassxc-cli show "$KEEPASSDB" meta/identity -a realname -a email | paste -d '' "$fields" - >> "$IDFILE"
|
||||
rm "$fields"
|
||||
|
||||
cat << "EOF" >> "$IDFILE"
|
||||
export ID_EMAIL_USER=$(basename "$ID_EMAIL" @gmail.com)
|
||||
EOF
|
Loading…
Reference in New Issue
Block a user