From f68f36448f5bc63211c12b9e53e9db603ed76178 Mon Sep 17 00:00:00 2001 From: Stefano Zacchiroli Date: Mon, 26 Mar 2012 20:47:34 +0200 Subject: [PATCH] notmuch-mutt: $XDG_CACHE_HOME support as per XDG basedir spec --- contrib/notmuch-mutt/notmuch-mutt | 4 +++- contrib/notmuch-mutt/notmuch-mutt.rc | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) mode change 100755 => 100644 contrib/notmuch-mutt/notmuch-mutt diff --git a/contrib/notmuch-mutt/notmuch-mutt b/contrib/notmuch-mutt/notmuch-mutt old mode 100755 new mode 100644 index 29674ec..9cd01ec --- a/contrib/notmuch-mutt/notmuch-mutt +++ b/contrib/notmuch-mutt/notmuch-mutt @@ -20,7 +20,9 @@ use String::ShellQuote; use Term::ReadLine; -my $cache_dir = "$ENV{HOME}/.cache/notmuch/mutt"; +my $xdg_cache_dir = "$ENV{HOME}/.cache"; +$xdg_cache_dir = $ENV{XDG_CACHE_HOME} if $ENV{XDG_CACHE_HOME}; +my $cache_dir = "$xdg_cache_dir/notmuch/mutt"; # create an empty maildir (if missing) or empty an existing maildir" diff --git a/contrib/notmuch-mutt/notmuch-mutt.rc b/contrib/notmuch-mutt/notmuch-mutt.rc index 269f03f..c0ff000 100644 --- a/contrib/notmuch-mutt/notmuch-mutt.rc +++ b/contrib/notmuch-mutt/notmuch-mutt.rc @@ -1,8 +1,8 @@ macro index \ - "unset wait_keynotmuch-mutt --prompt search~/.cache/notmuch/mutt/results" \ + "unset wait_keynotmuch-mutt --prompt search`echo ${XDG_CACHE_HOME:-$HOME/.cache}/notmuch/mutt/results`" \ "notmuch: search mail" macro index \ - "unset wait_keynotmuch-mutt thread~/.cache/notmuch/mutt/resultsset wait_key" \ + "unset wait_keynotmuch-mutt thread`echo ${XDG_CACHE_HOME:-$HOME/.cache}/notmuch/mutt/results`set wait_key" \ "notmuch: reconstruct thread" macro index \ "unset wait_keynotmuch-mutt tag -inbox" \ -- 1.7.9.1