From 5785a5d126210e8c9651da038b6c8b083041fef6 Mon Sep 17 00:00:00 2001 From: William Carroll Date: Mon, 23 Dec 2019 17:31:42 +0000 Subject: Support prelude/start-process If you refer to the previous commit where I change shell-command usages to start-process function calls, you'll see the rationale for why I prefer start-process. This commit introduces a more ergonomic API for start-process that fits most of my current use-cases of it. This cleans up the code. I have introduced a bug in the way that I'm tokenizing the COMMAND value. I've tracked that with a TODO. For now it only affects the `xmodmap -e ''` calls, which isn't too disruptive. --- configs/shared/.emacs.d/wpc/wallpaper.el | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'configs/shared/.emacs.d/wpc/wallpaper.el') diff --git a/configs/shared/.emacs.d/wpc/wallpaper.el b/configs/shared/.emacs.d/wpc/wallpaper.el index 841fe5428e7a..08758aef09c7 100644 --- a/configs/shared/.emacs.d/wpc/wallpaper.el +++ b/configs/shared/.emacs.d/wpc/wallpaper.el @@ -10,6 +10,7 @@ ;; Dependencies ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +(require 'prelude) (require 'fs) (require 'cycle) (require 'string) @@ -34,12 +35,9 @@ "Set computer wallpaper to image at `PATH' using `feh` under-the-hood. `PATH' can be absolute or relative since `f-expand' is called in the function body to ensure feh can resolve the path." - (start-process "*feh*" - nil - "feh" - "--bg-scale" - "--no-feh-bg" - (f-expand path))) + (prelude/start-process + :name "wallpaper/set" + :command (string/format "feh --bg-scale --no-feh-bg %s" (f-expand path)))) (defun wallpaper/whitelist-set (wallpaper) "Focuses the WALLPAPER in the `wallpaper/whitelist' cycle." -- cgit 1.4.1