From 4bacdfde98051ee5ac52eea094484a407d7f9a58 Mon Sep 17 00:00:00 2001 From: Daniel <89086143+BardofSprites@users.noreply.github.com> Date: Thu, 4 Jul 2024 23:12:32 -0400 Subject: cleanup formatting, change keybinds, remove unused keybinds --- bard-emacs-modules/bard-emacs-dired.el | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) (limited to 'bard-emacs-modules/bard-emacs-dired.el') diff --git a/bard-emacs-modules/bard-emacs-dired.el b/bard-emacs-modules/bard-emacs-dired.el index 41f8ee8..7e5a83c 100644 --- a/bard-emacs-modules/bard-emacs-dired.el +++ b/bard-emacs-modules/bard-emacs-dired.el @@ -30,14 +30,34 @@ (use-package image-dired :bind (:map dired-mode-map - ((")" . image-dired-dired-display-external))) + ((")" . image-dired-dired-display-external) + ("B" . bard/dired-set-background-with-feh))) + :bind + ("C-x C-d" . image-dired) + :bind + (:map image-dired-thumbnail-mode-map ("B" . bard/image-dired-set-background-with-feh)) :config (setq image-dired-thumbnail-storage 'standard) (setq image-dired-external-viewer "nsxiv") (setq image-dired-thumb-size 80) (setq image-dired-thumb-margin 2) (setq image-dired-thumb-relief 0) - (setq image-dired-thumbs-per-row 4)) + (setq image-dired-thumbs-per-row 4) + + (defun bard/dired-set-background-with-feh () + "Set the selected image as the background using feh." + (interactive) + (let ((image-file (dired-get-file-for-visit))) + (start-process "feh" nil "feh" "--bg-fill" image-file) + (message "Background set to %s" image-file))) + + (defun bard/image-dired-set-background-with-feh () + "Set the selected image as the background using feh." + (interactive) + (let ((image-file (image-dired-original-file-name))) + (start-process "feh" nil "feh" "--bg-fill" image-file) + (message "Background set to %s" image-file)))) + ;; Taken from https://superuser.com/a/176629 (defun bard/dired-do-command (command) -- cgit v1.2.3