diff options
author | Thanos Apollo <[email protected]> | 2023-10-16 06:34:10 +0300 |
---|---|---|
committer | Thanos Apollo <[email protected]> | 2023-10-16 06:34:10 +0300 |
commit | 9bc702695df94f15f9d4382349a3c0e28b1db3e4 (patch) | |
tree | bf41a475a70583a6044afd65ae399395f47649bd /.emacs.d | |
parent | 2cfb66a99818c9407f7d0362bba336566b37a15d (diff) |
emacs:(aesthetics) Rewrite wallpaper functions
Diffstat (limited to '.emacs.d')
-rw-r--r-- | .emacs.d/modules/thanos-aesthetics.el | 18 |
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) |