aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTeddy Wing2016-07-21 17:54:34 -0400
committerTeddy Wing2016-07-21 17:54:34 -0400
commit6a49faba8d13bcec7a6020f2413dac99008c89e4 (patch)
tree235c54cd6040c361780aff394f259a1dc960c810
parentf9d330b923322c17d2fe41647c1bf71e752aff30 (diff)
downloadqcd-6a49faba8d13bcec7a6020f2413dac99008c89e4.tar.bz2
qcd: Set config path locations
Use `XDG_CONFIG_HOME` (~/.config) to store our application support files. Put our database file in our directory there.
-rwxr-xr-xqcd5
1 files changed, 5 insertions, 0 deletions
diff --git a/qcd b/qcd
index a7acb3c..15f9fbf 100755
--- a/qcd
+++ b/qcd
@@ -1,6 +1,11 @@
# qcd
# Quickly `cd` into some frequently accessed project directories
+XDG_CONFIG_HOME=${XDG_CONFIG_HOME:-"${HOME}/.config"}
+QCD_CONFIG_DIR=${QCD_CONFIG_DIR:-"${XDG_CONFIG_HOME}/qcd"}
+QCD_DATABASE_FILE=${QCD_DATABASE_FILE:-"${QCD_CONFIG_DIR}/database"}
+
+
function qcd () {
if [[ $# < 1 ]]; then
echo 'Usage: qcd SHORTCUT' 1>&2