From: Thierry Volpiatto <thievol@posteo.net>
To: Stefan Kangas <stefankangas@gmail.com>
Cc: 57781@debbugs.gnu.org, Felix <felix.dick@web.de>,
Sean Whitton <spwhitton@spwhitton.name>
Subject: bug#57781: missing wallpaper command
Date: Sat, 17 Sep 2022 06:14:11 +0000 [thread overview]
Message-ID: <87tu56zfn3.fsf@posteo.net> (raw)
In-Reply-To: <CADwFkm=UW53+ZriBg7RGxKHVpUemwUeA5aOeT+Gud2yvVAm-NQ@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 2509 bytes --]
Stefan Kangas <stefankangas@gmail.com> writes:
> Thierry Volpiatto <thievol@posteo.net> writes:
>
>> Don't know if you already added a command for xfce, if not here is what
>> I use:
>>
>> (apply #'call-process "xfconf-query" nil nil nil
>> `("-c"
>> "xfce4-desktop" "-p"
>> "/backdrop/screen0/monitoreDP/workspace0/last-image" "-s"
>> ,file))
>
> I did not yet have the command, so thank you. I have added this to
> wallpaper.el on master now (commit fe7c015b20 or attached patch).
>
> Do you mind testing to see if it works for you?
The xconf-query command is detected and working fine, thanks.
Perhaps you can store last wallpapers used and use it as default for the
read-file-name?
Something like this:
diff --git a/lisp/image/wallpaper.el b/lisp/image/wallpaper.el
index 4572a8c0628..8426fc4b126 100644
--- a/lisp/image/wallpaper.el
+++ b/lisp/image/wallpaper.el
@@ -227,6 +227,8 @@ See also `wallpaper-default-height'.")
This is only used when it can't be detected automatically.
See also `wallpaper-default-width'.")
+(defvar wallpaper-last-used nil)
+
(defun wallpaper--get-height-or-width (desc fun default)
(if (display-graphic-p)
(funcall fun)
@@ -246,7 +248,10 @@ options `wallpaper-command' and `wallpaper-command-args'.
On MS-Windows and Haiku systems, no external command is needed,
so the value of `wallpaper-commands' is ignored."
(interactive (list (read-file-name "Set desktop background to: "
- default-directory nil t nil
+ (and wallpaper-last-used
+ (file-name-directory
+ (car (last wallpaper-last-used))))
+ wallpaper-last-used t nil
(lambda (fn)
(or (file-directory-p fn)
(string-match (image-file-name-regexp) fn))))))
@@ -257,6 +262,7 @@ so the value of `wallpaper-commands' is ignored."
(unless (file-readable-p file)
(error "File is not readable: %s" file))
(wallpaper-debug "Using image %S:" file)
+ (push file wallpaper-last-used)
(cond ((eq system-type 'windows-nt)
(w32-set-wallpaper file))
((featurep 'haiku)
> [2. text/x-diff; 0001-Support-XFCE-in-wallpaper.el.patch]...
--
Thierry
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 686 bytes --]
next prev parent reply other threads:[~2022-09-17 6:14 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-13 20:20 bug#57781: missing wallpaper command Felix
2022-09-14 5:41 ` Stefan Kangas
2022-09-14 17:00 ` Sean Whitton
2022-09-14 22:51 ` Stefan Kangas
2022-09-14 22:51 ` Felix
2022-09-14 23:22 ` Stefan Kangas
2022-09-15 9:47 ` Felix
2022-09-16 21:09 ` Stefan Kangas
2022-09-17 12:00 ` Felix
2022-09-17 17:48 ` Stefan Kangas
2022-09-18 11:16 ` Felix
2022-09-19 9:40 ` Stefan Kangas
2022-09-18 22:19 ` Felix
2022-09-19 9:40 ` Stefan Kangas
2022-09-19 17:19 ` Felix
2022-09-19 19:16 ` Stefan Kangas
2022-09-19 19:26 ` Felix
2022-09-19 20:07 ` Stefan Kangas
2022-09-19 21:04 ` Felix
2022-09-15 10:37 ` Felix
2022-09-16 21:09 ` Stefan Kangas
2022-09-16 15:50 ` Thierry Volpiatto
2022-09-16 20:52 ` Stefan Kangas
2022-09-17 6:14 ` Thierry Volpiatto [this message]
2022-09-17 18:34 ` Stefan Kangas
2022-09-18 3:33 ` Thierry Volpiatto
2022-10-04 5:58 ` Stefan Kangas
[not found] ` <87v8owv8lc.fsf@web.de>
2022-10-07 9:08 ` Stefan Kangas
2022-10-07 19:55 ` Felix
2022-10-07 20:16 ` Stefan Kangas
2022-09-14 23:25 ` Sean Whitton
2022-09-14 13:50 ` bug#57781: wbg " Felix
2022-09-14 16:27 ` Stefan Kangas
2022-09-14 20:01 ` Felix
2022-09-14 23:06 ` Stefan Kangas
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87tu56zfn3.fsf@posteo.net \
--to=thievol@posteo.net \
--cc=57781@debbugs.gnu.org \
--cc=felix.dick@web.de \
--cc=spwhitton@spwhitton.name \
--cc=stefankangas@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).