summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDylan Araps <dylan.araps@gmail.com>2019-01-13 14:49:07 +0200
committerDylan Araps <dylan.araps@gmail.com>2019-01-13 14:49:07 +0200
commit35dcc22db9852d54230a3473b7cde76726c2edc6 (patch)
treea347e3d310a21af9523c6cbb9bbc28f234dd8363
parentda7c0a71cc13e338941fb036d382b92abe5bbcf8 (diff)
general: Use XDG dirs by default.
-rwxr-xr-xfff8
1 files changed, 3 insertions, 5 deletions
diff --git a/fff b/fff
index c4497db..51786c2 100755
--- a/fff
+++ b/fff
@@ -14,9 +14,6 @@ get_os() {
haiku)
opener="open"
-
- # ':' is a way of avoiding 'var=var' when using '${:-}/${:+}/${:=}'.
- : "${FFF_TRASH:=$(finddir B_USER_CACHE_DIRECTORY)/fff/trash/}"
;;
esac
}
@@ -541,7 +538,8 @@ key() {
# Quit and store current directory in a file for CD on exit.
q)
- printf '%s\n' "$PWD" > "${FFF_CD_FILE:-$HOME/.fff_d}"
+ : "${FFF_CD_FILE:=${XDG_CACHE_HOME:=${HOME}/.cache}/fff/.fff_d}"
+ printf '%s\n' "$PWD" > "$FFF_CD_FILE"
exit
;;
esac
@@ -585,7 +583,7 @@ main() {
# Create the trash directory if it doesn't exist.
# Better to get this done early.
- mkdir -p "${FFF_TRASH:=${HOME}/.cache/fff/trash}"
+ mkdir -p "${FFF_TRASH:=${XDG_CACHE_HOME:=${HOME}/.cache}/fff/trash}"
# Trap the exit signal (we need to reset the terminal to a useable state.)
# '\e[?1049l': Restore saved terminal screen.