From c8de34fb55d8739df3dde0dad5a7114b1034a63e Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sun, 24 Jun 2018 23:22:25 +0200 Subject: [PATCH] Add +wakatime-hide-filenames option When enabled, wakatime will obfuscate filenames, hiding file information from your activity. --- modules/tools/wakatime/autoload.el | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/modules/tools/wakatime/autoload.el b/modules/tools/wakatime/autoload.el index 1e630398a..d030e85fe 100644 --- a/modules/tools/wakatime/autoload.el +++ b/modules/tools/wakatime/autoload.el @@ -3,6 +3,9 @@ (defvar +wakatime-api-file (concat doom-cache-dir "wakatime.el") "Where the wakatime api key is cached.") +(defvar +wakatime-hide-filenames nil + "If non-nil, obfuscate files and only show what projects you're working on.") + ;;;###autoload (add-hook 'doom-post-init-hook #'+wakatime|delayed-autostart) @@ -47,3 +50,9 @@ open a file." (add-hook 'doom-before-switch-buffer-hook #'+wakatime|autostart) ;; this is necessary in case the user opens emacs with file arguments (advice-add 'after-find-file :before #'+wakatime|autostart)) + +(defun +wakatime*append-hide-filenames-option (ret) + "Enables filename obfuscation in wakatime if `+wakatime-hide-filenames' is +non-nil." + (concat ret (if +wakatime-hide-filenames " --hide-filenames"))) +(advice-add #'wakatime-client-command :filter-return #'+wakatime*append-hide-filenames-option )