From 0f4d83078accdc51f31b2041af7d41ebf17ce93d Mon Sep 17 00:00:00 2001 From: nyuszika7h Date: Wed, 26 Jan 2022 12:06:45 +0100 Subject: [PATCH] Prefer XDG directory for WeeChat if it exists Closes #306. --- Makefile | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index a447b97..a1f89e4 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,12 @@ .PHONY: install install-lib install-dir uninstall phony test typecheck -WEECHAT_HOME ?= $(HOME)/.weechat +XDG_DATA_HOME ?= $(HOME)/.local/share + +ifneq ("$(wildcard $(XDG_DATA_HOME)/weechat)","") + WEECHAT_HOME ?= $(XDG_DATA_HOME)/weechat +else + WEECHAT_HOME ?= $(HOME)/.weechat +endif PREFIX ?= $(WEECHAT_HOME) INSTALLDIR := $(DESTDIR)$(PREFIX)/python/matrix