From 5fbe860b9564be2f046821d0dfc6afb51370a430 Mon Sep 17 00:00:00 2001 From: William Carroll Date: Mon, 23 Dec 2019 11:33:15 +0000 Subject: [PATCH] Prefer start-process to shell-command Without doing any benchmarking (break this naughty habit), I'm preferring to call `start-process` instead of `shell-command` in my `wallpaper/set` function. I noticed that the `shell-command` call was unnecessarily polluting my `pstree` call when I debugging my randomly changing wallpaper bug. I'm mostly likely going to change a few more `shell-command` calls to prefer `start-process`. --- configs/shared/.emacs.d/wpc/wallpaper.el | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/configs/shared/.emacs.d/wpc/wallpaper.el b/configs/shared/.emacs.d/wpc/wallpaper.el index 63548964b..841fe5428 100644 --- a/configs/shared/.emacs.d/wpc/wallpaper.el +++ b/configs/shared/.emacs.d/wpc/wallpaper.el @@ -31,8 +31,15 @@ "My preferred computer wallpapers.") (defun wallpaper/set (path) - "Set computer wallpaper to image at `PATH' using `feh` under-the-hood." - (shell-command (string/format "feh --bg-scale --no-fehbg %s" path))) + "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))) (defun wallpaper/whitelist-set (wallpaper) "Focuses the WALLPAPER in the `wallpaper/whitelist' cycle."