summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorblack <dylan.araps@gmail.com>2019-01-14 08:35:41 +0200
committerGitHub <noreply@github.com>2019-01-14 08:35:41 +0200
commitd0c42c91b2c0460e29b8ec8217e82edc8020b854 (patch)
treecb9ad16d43afa81d89b0a33100bad46b88d3815b
parentcb5fcdeb2ec77a1d066e9aa06b0778382fbfc67d (diff)
parent35dcc22db9852d54230a3473b7cde76726c2edc6 (diff)
Merge pull request #51 from dylanaraps/xdg
general: Use XDG dirs by default.
-rwxr-xr-xfff8
1 files changed, 3 insertions, 5 deletions
diff --git a/fff b/fff
index 0e8a217..77e77d1 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
}
@@ -634,7 +631,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
@@ -682,7 +680,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.