diff options
| author | Craig Jennings <c@cjennings.net> | 2026-05-10 14:08:01 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-05-10 14:08:01 -0500 |
| commit | 12c2cb141fcfd7ec14e04ce59e6294ffea4e2df9 (patch) | |
| tree | b7194cb4580d580bb3e3a2a17d16ffe07c46fecf /modules/dirvish-config.el | |
| parent | c75e36f4ec6764142499a3ec965d25895c564cb0 (diff) | |
| download | dotemacs-12c2cb141fcfd7ec14e04ce59e6294ffea4e2df9.tar.gz dotemacs-12c2cb141fcfd7ec14e04ce59e6294ffea4e2df9.zip | |
refactor(dirvish): use cj/executable-find-or-warn in cj/set-wallpaper
Migrate `cj/set-wallpaper' to the new helper. The old code messaged a bare `"%s not found"' when feh or swww was missing -- the helper produces a better message ("feh not found; wallpaper setter unavailable") that lands in *Warnings* instead of flashing once in the echo area.
Add `(require \='system-lib)' to dirvish-config.el per the Phase 2 exit criterion.
Audit notes for the other `executable-find' call sites in prog-shell, prog-c, prog-go, prog-python, browser-config: all silent `:if' / LSP-availability checks (spec says keep silent), or interactive commands with platform-specific install hints in their existing messages (`shellcheck`, `mypy`, `delve`). Migrating those would lose the install hints; leaving them.
Diffstat (limited to 'modules/dirvish-config.el')
| -rw-r--r-- | modules/dirvish-config.el | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/modules/dirvish-config.el b/modules/dirvish-config.el index f032b1a0..89f6c397 100644 --- a/modules/dirvish-config.el +++ b/modules/dirvish-config.el @@ -26,6 +26,7 @@ (eval-when-compile (require 'user-constants)) (eval-when-compile (require 'system-utils)) (require 'host-environment) +(require 'system-lib) ;; mark files in dirvish, attach in mu4e (add-hook 'dired-mode-hook 'turn-on-gnus-dired-mode) @@ -301,16 +302,14 @@ Uses feh on X11, swww on Wayland." ((env-wayland-p) 'wayland) (t nil))) (cmd (cj/--wallpaper-program-for env))) - (cond - ((null cmd) - (message "Unknown display server (not X11 or Wayland)")) - ((not (executable-find (car cmd))) - (message "%s not found" (car cmd))) - (t - (apply #'call-process (car cmd) nil 0 nil - (append (cdr cmd) (list file))) - (message "Wallpaper set: %s (%s)" - (file-name-nondirectory file) (car cmd)))))) + (if (null cmd) + (message "Unknown display server (not X11 or Wayland)") + (when-let ((path (cj/executable-find-or-warn + (car cmd) "wallpaper setter" 'dirvish-config))) + (apply #'call-process path nil 0 nil + (append (cdr cmd) (list file))) + (message "Wallpaper set: %s (%s)" + (file-name-nondirectory file) (car cmd)))))) ;;; ---------------------------------- Dirvish ---------------------------------- |
