summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Kangas <stefankangas@gmail.com>2022-09-13 18:02:21 +0200
committerStefan Kangas <stefankangas@gmail.com>2022-09-13 18:25:21 +0200
commit3713183a3db73a720dbcf20a5b6bf3bf3232a301 (patch)
treed86fed35050267b1425f71c73ff8e890fde074d6
parent535adb96f6c1be7f43ba5d1b04b3d00e1c94b626 (diff)
downloademacs-3713183a3db73a720dbcf20a5b6bf3bf3232a301.tar.gz
Use wallpaper-set in thumbs.el
* lisp/thumbs.el (wallpaper): Require. (thumbs-setroot-command): Make defcustom obsolete. (thumbs-call-setroot-command): Make obsolete in favor of wallpaper-set. (thumbs-set-image-at-point-to-root-window, thumbs-set-root) (thumbs-dired-setroot): Use wallpaper-set instead of thumbs-call-setroot-command. (thumbs-before-setroot-hook, thumbs-after-setroot-hook): Make obsolete.
-rw-r--r--lisp/thumbs.el17
1 files changed, 11 insertions, 6 deletions
diff --git a/lisp/thumbs.el b/lisp/thumbs.el
index 0b3d36d6e31..0c5307f8de3 100644
--- a/lisp/thumbs.el
+++ b/lisp/thumbs.el
@@ -54,6 +54,7 @@
;;; Code:
(require 'dired)
+(require 'wallpaper)
(require 'cl-lib) ; for cl-gensym
;; CUSTOMIZATIONS
@@ -99,6 +100,8 @@ This must be the ImageMagick \"convert\" utility."
:type 'string
:version "28.1")
+(make-obsolete-variable 'thumbs-setroot-command
+ 'wallpaper-commands-alist "29.1")
(defcustom thumbs-setroot-command
"xloadimage -onroot -fullscreen *"
"Command to set the root window."
@@ -425,6 +428,7 @@ Open another window."
(defun thumbs-call-setroot-command (img)
"Call the setroot program for IMG."
+ (declare (obsolete wallpaper-set "29.1"))
(run-hooks 'thumbs-before-setroot-hook)
(shell-command (string-replace
"*"
@@ -435,15 +439,13 @@ Open another window."
(defun thumbs-set-image-at-point-to-root-window ()
"Set the image at point as the desktop wallpaper."
(interactive)
- (thumbs-call-setroot-command
- (thumbs-current-image)))
+ (wallpaper-set (thumbs-current-image)))
(defun thumbs-set-root ()
"Set the current image as root."
(interactive)
- (thumbs-call-setroot-command
- (or thumbs-current-tmp-filename
- thumbs-current-image-filename)))
+ (wallpaper-set (or thumbs-current-tmp-filename
+ thumbs-current-image-filename)))
(defun thumbs-file-alist ()
"Make an alist of elements (POS . FILENAME) for all images in thumb buffer."
@@ -756,13 +758,16 @@ ACTION and ARG should be a valid convert command."
(defun thumbs-dired-setroot ()
"In dired, call the setroot program on the image at point."
(interactive)
- (thumbs-call-setroot-command (dired-get-filename)))
+ (wallpaper-set (dired-get-filename)))
;; Modif to dired mode map
(define-key dired-mode-map "\C-ta" 'thumbs-dired-show)
(define-key dired-mode-map "\C-tm" 'thumbs-dired-show-marked)
(define-key dired-mode-map "\C-tw" 'thumbs-dired-setroot)
+(make-obsolete-variable 'thumbs-before-setroot-hook nil "29.1")
+(make-obsolete-variable 'thumbs-after-setroot-hook nil "29.1")
+
(define-obsolete-function-alias 'thumbs-image-type
#'image-supported-file-p "29.1")