From c327eb18c62d27c07c652b861fe8061fa8beeeb8 Mon Sep 17 00:00:00 2001 From: Gergely Polonkai Date: Tue, 31 Jan 2023 08:47:36 +0100 Subject: [PATCH] Make the xdg dependency optional We now default to using `~/.cache/waybar-current-task.json` if the `xdg` package is not present. --- org-clock-waybar.el | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/org-clock-waybar.el b/org-clock-waybar.el index 8a5f7f2..6315251 100644 --- a/org-clock-waybar.el +++ b/org-clock-waybar.el @@ -38,7 +38,7 @@ ;;; Code: -(require 'xdg) +(require 'xdg nil t) (require 'json) (require 'org-clock) @@ -47,7 +47,9 @@ :group 'emacs) (defcustom org-clock-waybar-filename - (expand-file-name "waybar-current-task.json" (xdg-cache-home)) + (if (fboundp 'xdg-cache-home) + (expand-file-name "waybar-current-task.json" (xdg-cache-home)) + (expand-file-name "~/.cache/waybar-current-task.json")) "Name of the file to save task data to." :type 'string :group 'org-clock-waybar)