diff options
author | Toby Vincent <tobyv@tobyvin.dev> | 2024-05-20 21:31:21 -0500 |
---|---|---|
committer | Toby Vincent <tobyv@tobyvin.dev> | 2024-05-20 21:31:21 -0500 |
commit | 4cfcc3e5863644aa7fed8e9347bb2bcbf47d7fb0 (patch) | |
tree | bde551f3544172d9cc4924e8d7da53dedca1c4e8 /notmuch/.local/bin | |
parent | 05904eb11ca70835e98f6f6240a6588855f8bfc5 (diff) |
feat(i3blocks): add more scripts
Diffstat (limited to 'notmuch/.local/bin')
-rwxr-xr-x | notmuch/.local/bin/notmuch-notify | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/notmuch/.local/bin/notmuch-notify b/notmuch/.local/bin/notmuch-notify index f808c4d..bc93f09 100755 --- a/notmuch/.local/bin/notmuch-notify +++ b/notmuch/.local/bin/notmuch-notify @@ -18,11 +18,19 @@ def notify(title, message): ) +# Workaround for bug in the notmuch module's default config resolution +if os.environ.get("NOTMUCH_CONFIG") is None: + os.environ["NOTMUCH_CONFIG"] = os.path.join( + os.environ.get( + "XDG_CONFIG_HOME", os.path.join(os.path.expanduser("~"), ".config") + ), + "notmuch", + os.environ.get("NOTMUCH_PROFILE", "default"), + "config", + ) + for message in ( notmuch.Database( - path="{}/mail".format( - os.getenv("XDG_DATA_HOME", os.path.expanduser("~/.local/share")) - ), mode=notmuch.Database.MODE.READ_WRITE, ) .create_query("tag:notify") |