From 2802813d23c992a1513c474429312747c0232953 Mon Sep 17 00:00:00 2001 From: Thanos Apollo Date: Sun, 8 Oct 2023 16:17:36 +0300 Subject: emacs:(aesthetics) Add thanos/set-wallpaper Function to set wallpaper using feh --- .emacs.d/modules/thanos-aesthetics.el | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to '.emacs.d/modules/thanos-aesthetics.el') diff --git a/.emacs.d/modules/thanos-aesthetics.el b/.emacs.d/modules/thanos-aesthetics.el index ac848ee..3f468fe 100644 --- a/.emacs.d/modules/thanos-aesthetics.el +++ b/.emacs.d/modules/thanos-aesthetics.el @@ -245,5 +245,17 @@ (global-set-key (kbd "M-.") 'xref-find-definitions) (global-set-key (kbd "C-c l") 'display-line-numbers-mode) +;; wallpapers +(defvar wallpapers-dir "~/wallpapers/") + +(defun thanos/set-wallpaper () + "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))) + +(define-key thanos/applications-map (kbd "w") 'thanos/set-wallpaper) + (provide 'thanos-aesthetics) ;;; thanos-aesthetics.el ends here -- cgit v1.2.3