Skip to content

Commit

Permalink
Add firefox wrapper
Browse files Browse the repository at this point in the history
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).
  • Loading branch information
ayekat committed May 5, 2017
1 parent 80c9d46 commit 0524cad
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions 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" "$@"

0 comments on commit 0524cad

Please sign in to comment.