summaryrefslogtreecommitdiff
path: root/.emacs.d/modules/thanos-aesthetics.el
diff options
context:
space:
mode:
Diffstat (limited to '.emacs.d/modules/thanos-aesthetics.el')
-rw-r--r--.emacs.d/modules/thanos-aesthetics.el18
1 files changed, 14 insertions, 4 deletions
diff --git a/.emacs.d/modules/thanos-aesthetics.el b/.emacs.d/modules/thanos-aesthetics.el
index 99def17..fb28f64 100644
--- a/.emacs.d/modules/thanos-aesthetics.el
+++ b/.emacs.d/modules/thanos-aesthetics.el
@@ -251,14 +251,24 @@
;; wallpapers
(defvar wallpapers-dir "~/wallpapers/")
-(defun thanos/set-wallpaper ()
+(defun thanos/wallpaper-set (image)
+ "Set IMAGE as wallpaper, using feh."
+ (call-process-shell-command
+ (concat "feh --bg-scale " wallpapers-dir image) nil 0))
+
+(defun thanos/wallpaper-random ()
+ "Set random wallpaper."
+ (interactive)
+ (let ((wallpapers (directory-files "~/wallpapers" nil "^[^.].*")))
+ (thanos/wallpaper-set (nth (random (length wallpapers)) wallpapers))))
+
+(defun thanos/wallpaper-select ()
"Set wallpaper."
(interactive)
(let ((wallpaper (completing-read "Choose wallpaper: " (directory-files wallpapers-dir nil "^[^.].*"))))
- (call-process-shell-command
- (concat "feh --bg-scale " wallpapers-dir wallpaper) nil 0)))
+ (thanos/wallpaper-set wallpaper)))
-(define-key thanos/applications-map (kbd "w") 'thanos/set-wallpaper)
+(define-key thanos/applications-map (kbd "w") 'thanos/wallpaper-select)
;; Symbols
(add-hook 'emacs-lisp-mode-hook 'prettify-symbols-mode)