about summary refs log tree commit diff
path: root/configs/shared
diff options
context:
space:
mode:
authorWilliam Carroll <wpcarro@gmail.com>2019-12-23T11·33+0000
committerWilliam Carroll <wpcarro@gmail.com>2020-01-06T15·25+0000
commit5fbe860b9564be2f046821d0dfc6afb51370a430 (patch)
treec818619c8e536288e951bcc56a03d34249f312c7 /configs/shared
parent4e454f0466767c768d4594c90c6815c06466fe67 (diff)
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`.
Diffstat (limited to 'configs/shared')
-rw-r--r--configs/shared/.emacs.d/wpc/wallpaper.el11
1 files changed, 9 insertions, 2 deletions
diff --git a/configs/shared/.emacs.d/wpc/wallpaper.el b/configs/shared/.emacs.d/wpc/wallpaper.el
index 63548964b76d..841fe5428e7a 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<wallpaper/set>*"
+                 nil
+                 "feh"
+                 "--bg-scale"
+                 "--no-feh-bg"
+                 (f-expand path)))
 
 (defun wallpaper/whitelist-set (wallpaper)
   "Focuses the WALLPAPER in the `wallpaper/whitelist' cycle."