Add new command image-dired-set-wallpaper

* lisp/image/image-dired.el (wallpaper): Require.
(image-dired-set-wallpaper): New command.
(image-dired-thumbnail-mode-map): Bind above new command to "W".
This commit is contained in:
Stefan Kangas 2022-09-13 17:56:22 +02:00
parent 32b7aaa9f1
commit 535adb96f6
2 changed files with 13 additions and 3 deletions

View file

@ -2052,6 +2052,11 @@ If 'image-dired-thumb-mark' is non-nil (the default), this face is
used for images that are flagged for deletion in the Dired buffer
associated with Image-Dired.
---
*** New command 'image-dired-wallpaper-set'.
This command sets the wallpaper to the image at point in the thumbnail
buffer. It is bound to 'W' by default.
---
*** 'image-dired-slideshow-start' is now bound to 'S'.
It is bound in both the thumbnail and display buffer.

View file

@ -55,7 +55,6 @@
;;
;; file-name-non-directory;comment:comment-text;tag1;tag2;tag3;...;tagN
;;
;;
;; PREREQUISITES
;; =============
;;
@ -109,8 +108,6 @@
;; * From thumbs.el: Add an option for clean-up/max-size functionality
;; for thumbnail directory.
;;
;; * From thumbs.el: Add setroot function.
;;
;; * Add `image-dired-display-thumbs-ring' and functions to cycle that. Find out
;; which is best, saving old batch just before inserting new, or
;; saving the current batch in the ring when inserting it. Adding
@ -135,6 +132,7 @@
(require 'dired)
(require 'image-mode)
(require 'wallpaper)
(require 'widget)
(require 'xdg)
@ -861,6 +859,7 @@ You probably want to use this together with
"SPC" #'image-dired-display-next-thumbnail-original
"DEL" #'image-dired-display-previous-thumbnail-original
"c" #'image-dired-comment-thumbnail
"W" #'image-dired-wallpaper-set
;; Mouse
"<mouse-2>" #'image-dired-mouse-display-image
@ -1152,6 +1151,12 @@ With prefix ARG, move that many thumbnails."
(interactive "p" image-dired-thumbnail-mode image-dired-display-image-mode)
(image-dired-display-next-thumbnail-original (- arg)))
(defun image-dired-wallpaper-set (file)
"Set the wallpaper to FILE in a graphical environment."
(interactive (list (image-dired-original-file-name))
image-dired-thumbnail-mode)
(wallpaper-set file))
;;; Image Comments