crypto is cool

This commit is contained in:
Christoph J. Scherr 2025-01-22 02:26:14 +01:00
parent 1efed5c274
commit 39722ea19f
1 changed files with 25 additions and 2 deletions

27
.zshrc
View File

@ -13,8 +13,8 @@ export CLIPBOARD_NOGUI=0 # wayland only allows GUI apps to use the clipboard.
# For wayland, set this to `1`
# see https://github.com/Slackadays/Clipboard/issues/171
export DATEFMT='+%a %Y-%m-%d %X'
export EDITOR=nvim
export VISUAL=nvim
export EDITOR=$(which nvim)
export VISUAL=$(which nvim)
### Aliases
@ -302,9 +302,32 @@ function load_nvm() {
}
# zprof
# gpg is cool actually
# crypto stuff with my gpg keys
export IDENTITY="Christoph J. Scherr <software@cscherr.de>"
export KEY_TYPE=ed25519
export KEYID=0E777B31ACC5B69B7096C050A466E5C5D6792EE9
gpgencrypt () {
output="${1}".$(date +%s).enc
gpg --encrypt --armor --output ${output} \
-r $KEYID "${1}" && echo "${1} -> ${output}"
}
gpgdecrypt () {
output=$(echo "${1}" | rev | cut -c16- | rev)
gpg --decrypt --output ${output} "${1}" && \
echo "${1} -> ${output}"
}
### load unversioned zsh code
if [ -f ~/.zsh.local ]; then
source ~/.zsh.local
else
touch ~/.zsh.local
fi
if [ -f ~/.zshenv ]; then
source ~/.zshenv
else
touch ~/.zshenv
fi