From 0524cadfb67f7b266321c15b9db8c33c9dba0e87 Mon Sep 17 00:00:00 2001 From: ayekat Date: Fri, 5 May 2017 10:33:13 +0200 Subject: [PATCH] Add firefox wrapper Now, this is *really* ugly - I'm exploiting the fact that firefox respects $HOME for determining the user's home directory. Don't try this at... home! (*ba-dum-ts*) I also log every call to this script. The idea is to get a usage frequency to determine at what point I'm safe to uninstall firefox without causing any headaches later on (e.g. when the "last use" timestamp dates back several months). --- bin/firefox | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100755 bin/firefox diff --git a/bin/firefox b/bin/firefox new file mode 100755 index 00000000..f792582a --- /dev/null +++ b/bin/firefox @@ -0,0 +1,15 @@ +#!/usr/bin/env sh +. "$(dirname "$0")"/path.sh + +# Set up data directory: +MOZDIR="$XDG_DATA_HOME"/mozilla +if [ ! -d "$MOZDIR" ]; then + mkdir "$MOZDIR" + ln -s "$HOME"/tmp "$MOZDIR"/tmp # TODO XDG_DOWNLOAD_DIR, don't hardcode +fi + +# Log "last used" (for statistics): +mkdir -p "$XDG_LOG_HOME"/mozilla +date -Iseconds >> "$XDG_LOG_HOME"/mozilla/usage.log + +HOME="$XDG_DATA_HOME"/mozilla exec "$EPATH" "$@"