fixed ${XDG_CONFIG_HOME} based configuration path

This commit is contained in:
alterNERDtive 2024-04-23 20:00:43 +02:00
parent ff17c6b92c
commit 169071c7dd
Signed by: alterNERDtive
GPG key ID: 547787A4FE6533F1

View file

@ -2,7 +2,7 @@
_dependencies=("echo" "gpg" "ln" "ls" "mktemp" "mkdir" "mv" "rm" "udisksctl") _dependencies=("echo" "gpg" "ln" "ls" "mktemp" "mkdir" "mv" "rm" "udisksctl")
_tempdir=/tmp/gpgtool.tempdir _tempdir=/tmp/gpgtool.tempdir
# Sets up GPGtool. Creates temporary GNUPG home directory, mounts key device if # Sets up GPGtool. Creates temporary GNUPG home directory, mounts key device if
# given, checks for key directory. # given, checks for key directory.
init () { init () {
local dev local dev
@ -146,7 +146,7 @@ list () {
fi fi
} }
# Opens a key from the key path. Imports into temporary GPG and links the secret # Opens a key from the key path. Imports into temporary GPG and links the secret
# key. # key.
open () { open () {
_checkinit _checkinit
@ -169,7 +169,7 @@ open () {
done done
} }
# Closes a key from the key path. Deletes the secret key. does not delete the # Closes a key from the key path. Deletes the secret key. does not delete the
# actual key; that will be disposed of in the end anyway. # actual key; that will be disposed of in the end anyway.
close () { close () {
_checkinit _checkinit
@ -300,7 +300,7 @@ done
[[ "$1" =~ "(-h|--help|help)" ]] && usage && exit 0 [[ "$1" =~ "(-h|--help|help)" ]] && usage && exit 0
# Source config file: # Source config file:
for dir in "$(dirname $0)" "${HOME}/.config/gpgtool" "${XDG_CONFIG_HOME}" for dir in "$(dirname $0)" "${HOME}/.config/gpgtool" "${XDG_CONFIG_HOME}/gpgtool"
do do
[[ -f "${dir}/gpgtool.conf" ]] && source "${dir}/gpgtool.conf" [[ -f "${dir}/gpgtool.conf" ]] && source "${dir}/gpgtool.conf"
done done