diff options
author | bd <bdunahu@operationnull.com> | 2024-12-15 01:27:20 -0500 |
---|---|---|
committer | bd <bdunahu@operationnull.com> | 2024-12-15 01:27:20 -0500 |
commit | e007e1c239f1b4667377ca4ce09e34fbbafd4c9d (patch) | |
tree | 605e844e80cea40963dbf0da1dc6131be3fc666c /.config/emacs/modules/bd--exwm-windowing.el | |
parent | 9e6f8a165ec1f1ba865ecec929341f91dc97730f (diff) |
Moved rip-video / set-bg to elisp
Diffstat (limited to '.config/emacs/modules/bd--exwm-windowing.el')
-rw-r--r-- | .config/emacs/modules/bd--exwm-windowing.el | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/.config/emacs/modules/bd--exwm-windowing.el b/.config/emacs/modules/bd--exwm-windowing.el index 7f52d2a..3b6532b 100644 --- a/.config/emacs/modules/bd--exwm-windowing.el +++ b/.config/emacs/modules/bd--exwm-windowing.el @@ -53,6 +53,26 @@ (interactive) (bd/set-brightness "5%+")) +(defun set-bg (&optional arg) + "Set the current wallpaper using feh. +ARG can be one of the following: + +- nil: set the most recent wallpaper +- directory: set a random image from the directory +- file: set the specified file" + (interactive "f") + (let ((wall (expand-file-name "~/wf/wall/current"))) + (and arg + (cond + ((file-regular-p arg) (copy-file arg wall t)) + ((file-directory-p arg) + (let* ((images (f-files arg (lambda (f) (string-match-p "\\.jpeg\\'" f)))) + (rfile (nth (random (length images)) images))) + (and rfile (copy-file rfile wall t)))))) + (start-process "set wallpaper" nil "feh" "--bg-fill" wall) + (message "Set wallpaper."))) +(set-bg) + (use-package exwm :config |