aboutsummaryrefslogtreecommitdiff
path: root/bard-emacs-modules/bard-emacs-dired.el
diff options
context:
space:
mode:
authorDaniel <[email protected]>2024-07-04 23:12:32 -0400
committerDaniel <[email protected]>2024-07-04 23:12:32 -0400
commit4bacdfde98051ee5ac52eea094484a407d7f9a58 (patch)
tree32f00b2723e846677516ad8348c7f0311cb5f4c6 /bard-emacs-modules/bard-emacs-dired.el
parentfda717c671b415d251eb2e8db377ae0ad75d9f7f (diff)
cleanup
formatting, change keybinds, remove unused keybinds
Diffstat (limited to 'bard-emacs-modules/bard-emacs-dired.el')
-rw-r--r--bard-emacs-modules/bard-emacs-dired.el24
1 files changed, 22 insertions, 2 deletions
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)