GNU bug report logs - #57781
missing wallpaper command

Previous Next

Package: emacs;

Reported by: Felix <felix.dick <at> web.de>

Date: Tue, 13 Sep 2022 20:31:01 UTC

Severity: normal

Fixed in version 29.1

Done: Stefan Kangas <stefankangas <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 57781 in the body.
You can then email your comments to 57781 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#57781; Package emacs. (Tue, 13 Sep 2022 20:31:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Felix <felix.dick <at> web.de>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Tue, 13 Sep 2022 20:31:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Felix <felix.dick <at> web.de>
To: bug-gnu-emacs <at> gnu.org
Subject: missing wallpaper command
Date: Tue, 13 Sep 2022 22:20:31 +0200
I'm not using swaybg but wbg as wallpaper command on wayland which is
not yet part of the wallpaper-commands.
'wallpaper-set' works if i evaluate:
(add-to-list 'wallpaper-commands '("wbg" "%f"))




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#57781; Package emacs. (Wed, 14 Sep 2022 05:42:02 GMT) Full text and rfc822 format available.

Message #8 received at 57781 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefankangas <at> gmail.com>
To: Felix <felix.dick <at> web.de>, 57781 <at> debbugs.gnu.org
Subject: Re: bug#57781: missing wallpaper command
Date: Tue, 13 Sep 2022 22:41:01 -0700
tags 57781 + pending
thanks

Felix <felix.dick <at> web.de> writes:

> I'm not using swaybg but wbg as wallpaper command on wayland which is
> not yet part of the wallpaper-commands.
> 'wallpaper-set' works if i evaluate:
> (add-to-list 'wallpaper-commands '("wbg" "%f"))

Thanks for the bug report!

I've added it now (commit f0798ac13d), could you please test?

To test for Wayland, it only checks if $WAYLAND_DISPLAY is set.
We could do something more fancy if needed, possibly involving
loginctl.




Added tag(s) pending. Request was from Stefan Kangas <stefankangas <at> gmail.com> to control <at> debbugs.gnu.org. (Wed, 14 Sep 2022 05:42:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#57781; Package emacs. (Wed, 14 Sep 2022 13:56:01 GMT) Full text and rfc822 format available.

Message #13 received at 57781 <at> debbugs.gnu.org (full text, mbox):

From: Felix <felix.dick <at> web.de>
To: 57781 <at> debbugs.gnu.org
Subject: wbg wallpaper command
Date: Wed, 14 Sep 2022 15:50:27 +0200
It is not working like this.
It does work the %f needs to be double quoted:

("wbg" "%f")

Thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#57781; Package emacs. (Wed, 14 Sep 2022 16:28:02 GMT) Full text and rfc822 format available.

Message #16 received at 57781 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefankangas <at> gmail.com>
To: Felix <felix.dick <at> web.de>, 57781 <at> debbugs.gnu.org
Subject: Re: bug#57781: wbg wallpaper command
Date: Wed, 14 Sep 2022 09:27:25 -0700
Felix <felix.dick <at> web.de> writes:

> It is not working like this.
> It does work the %f needs to be double quoted:
>
> ("wbg" "%f")

Sorry, that was a typo; fixed now.  Do you mind trying again?

Thanks in advance.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#57781; Package emacs. (Wed, 14 Sep 2022 17:02:02 GMT) Full text and rfc822 format available.

Message #19 received at 57781 <at> debbugs.gnu.org (full text, mbox):

From: Sean Whitton <spwhitton <at> spwhitton.name>
To: Stefan Kangas <stefankangas <at> gmail.com>, Felix <felix.dick <at> web.de>,
 57781 <at> debbugs.gnu.org
Subject: Re: bug#57781: missing wallpaper command
Date: Wed, 14 Sep 2022 10:00:53 -0700
Hello,

On Tue 13 Sep 2022 at 10:41PM -07, Stefan Kangas wrote:

> tags 57781 + pending
> thanks
>
> Felix <felix.dick <at> web.de> writes:
>
>> I'm not using swaybg but wbg as wallpaper command on wayland which is
>> not yet part of the wallpaper-commands.
>> 'wallpaper-set' works if i evaluate:
>> (add-to-list 'wallpaper-commands '("wbg" "%f"))
>
> Thanks for the bug report!
>
> I've added it now (commit f0798ac13d), could you please test?
>
> To test for Wayland, it only checks if $WAYLAND_DISPLAY is set.
> We could do something more fancy if needed, possibly involving
> loginctl.

Since it's protocol-dependent, I don't know if it will work on anything
other than wlroots-based compositors.  Before relying solely on
WAYLAND_DISPLAY, perhaps we should also check it works with GNOME?

-- 
Sean Whitton




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#57781; Package emacs. (Wed, 14 Sep 2022 20:12:02 GMT) Full text and rfc822 format available.

Message #22 received at 57781 <at> debbugs.gnu.org (full text, mbox):

From: Felix <felix.dick <at> web.de>
To: 57781 <at> debbugs.gnu.org
Subject: Re: bug#57781: wbg wallpaper command
Date: Wed, 14 Sep 2022 22:01:30 +0200
Stefan Kangas <stefankangas <at> gmail.com> writes:

> Felix <felix.dick <at> web.de> writes:
>
>> It is not working like this.
>> It does work the %f needs to be double quoted:
>>
>> ("wbg" "%f")
>
> Sorry, that was a typo; fixed now.  Do you mind trying again?
>
> Thanks in advance.

No need to apologize! I'm forever thankful for all the work that's
done by you and all the people working on emacs!
It works now!
Thanks a lot,
Felix




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#57781; Package emacs. (Wed, 14 Sep 2022 22:52:01 GMT) Full text and rfc822 format available.

Message #25 received at 57781 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefankangas <at> gmail.com>
To: Sean Whitton <spwhitton <at> spwhitton.name>, Felix <felix.dick <at> web.de>,
 57781 <at> debbugs.gnu.org
Subject: Re: bug#57781: missing wallpaper command
Date: Wed, 14 Sep 2022 15:51:02 -0700
Sean Whitton <spwhitton <at> spwhitton.name> writes:

>> To test for Wayland, it only checks if $WAYLAND_DISPLAY is set.
>> We could do something more fancy if needed, possibly involving
>> loginctl.
>
> Since it's protocol-dependent, I don't know if it will work on anything
> other than wlroots-based compositors.  Before relying solely on
> WAYLAND_DISPLAY, perhaps we should also check it works with GNOME?

I need help here, as I don't have access to Wayland.

Would you be willing to help test it, and/or make concrete suggestions
for how to do better?  I'd ideally need someone to tell me which
environment variables or commands to run, and which values to expect,
but any information you could provide would help.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#57781; Package emacs. (Wed, 14 Sep 2022 23:05:01 GMT) Full text and rfc822 format available.

Message #28 received at 57781 <at> debbugs.gnu.org (full text, mbox):

From: Felix <felix.dick <at> web.de>
To: Stefan Kangas <stefankangas <at> gmail.com>
Cc: 57781 <at> debbugs.gnu.org, Sean Whitton <spwhitton <at> spwhitton.name>
Subject: Re: bug#57781: missing wallpaper command
Date: Thu, 15 Sep 2022 00:51:39 +0200
Stefan Kangas <stefankangas <at> gmail.com> writes:

> Sean Whitton <spwhitton <at> spwhitton.name> writes:
>
>>> To test for Wayland, it only checks if $WAYLAND_DISPLAY is set.
>>> We could do something more fancy if needed, possibly involving
>>> loginctl.
>>
>> Since it's protocol-dependent, I don't know if it will work on anything
>> other than wlroots-based compositors.  Before relying solely on
>> WAYLAND_DISPLAY, perhaps we should also check it works with GNOME?
>
> I need help here, as I don't have access to Wayland.
>
> Would you be willing to help test it, and/or make concrete suggestions
> for how to do better?  I'd ideally need someone to tell me which
> environment variables or commands to run, and which values to expect,
> but any information you could provide would help.

I'm switching back and forth from Xorg to wayland and I'm
tinkering with different desktops/WMs anyways.
I would be happy to help!
I will try wallpaper.el with gnome tomorrow.
If there are any things you want me
to test, just let me know.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#57781; Package emacs. (Wed, 14 Sep 2022 23:07:02 GMT) Full text and rfc822 format available.

Message #31 received at 57781 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefankangas <at> gmail.com>
To: Felix <felix.dick <at> web.de>, 57781 <at> debbugs.gnu.org
Subject: Re: bug#57781: wbg wallpaper command
Date: Wed, 14 Sep 2022 16:06:45 -0700
close 57781 29.1
thanks

Felix <felix.dick <at> web.de> writes:

> It works now!

Thanks for testing, I'm therefore closing this bug.

Sean Whitton has made some further suggestions; we can continue
discussing them in this bug report for now.  Someone could also create a
new bug report, if that's better.




bug marked as fixed in version 29.1, send any further explanations to 57781 <at> debbugs.gnu.org and Felix <felix.dick <at> web.de> Request was from Stefan Kangas <stefankangas <at> gmail.com> to control <at> debbugs.gnu.org. (Wed, 14 Sep 2022 23:07:03 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#57781; Package emacs. (Wed, 14 Sep 2022 23:23:01 GMT) Full text and rfc822 format available.

Message #36 received at 57781 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefankangas <at> gmail.com>
To: Felix <felix.dick <at> web.de>
Cc: 57781 <at> debbugs.gnu.org, Sean Whitton <spwhitton <at> spwhitton.name>
Subject: Re: bug#57781: missing wallpaper command
Date: Wed, 14 Sep 2022 16:22:09 -0700
Felix <felix.dick <at> web.de> writes:

> I'm switching back and forth from Xorg to wayland and I'm
> tinkering with different desktops/WMs anyways.
> I would be happy to help!
> I will try wallpaper.el with gnome tomorrow.
> If there are any things you want me
> to test, just let me know.

Thank you!  That offer to help is much appreciated.

I know next to nothing about Wayland, but any testing you could do with
Gnome, KDE and Sway is welcome.  Or anything else you think might be
useful and worth doing, really.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#57781; Package emacs. (Wed, 14 Sep 2022 23:27:01 GMT) Full text and rfc822 format available.

Message #39 received at 57781 <at> debbugs.gnu.org (full text, mbox):

From: Sean Whitton <spwhitton <at> spwhitton.name>
To: Stefan Kangas <stefankangas <at> gmail.com>, Felix <felix.dick <at> web.de>,
 57781 <at> debbugs.gnu.org
Subject: Re: bug#57781: missing wallpaper command
Date: Wed, 14 Sep 2022 16:25:54 -0700
Hello,

On Wed 14 Sep 2022 at 03:51PM -07, Stefan Kangas wrote:

> Sean Whitton <spwhitton <at> spwhitton.name> writes:
>
>>> To test for Wayland, it only checks if $WAYLAND_DISPLAY is set.
>>> We could do something more fancy if needed, possibly involving
>>> loginctl.
>>
>> Since it's protocol-dependent, I don't know if it will work on anything
>> other than wlroots-based compositors.  Before relying solely on
>> WAYLAND_DISPLAY, perhaps we should also check it works with GNOME?
>
> I need help here, as I don't have access to Wayland.
>
> Would you be willing to help test it, and/or make concrete suggestions
> for how to do better?  I'd ideally need someone to tell me which
> environment variables or commands to run, and which values to expect,
> but any information you could provide would help.

Yes, though sounds like it's easier for Felix to switch back and forth,
so perhaps I can test the final version of it, or something.  LMK.

-- 
Sean Whitton




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#57781; Package emacs. (Thu, 15 Sep 2022 10:17:02 GMT) Full text and rfc822 format available.

Message #42 received at 57781 <at> debbugs.gnu.org (full text, mbox):

From: Felix <felix.dick <at> web.de>
To: Stefan Kangas <stefankangas <at> gmail.com>,Sean Whitton
 <spwhitton <at> spwhitton.name>, 57781 <at> debbugs.gnu.org
Subject: Re: bug#57781: missing wallpaper command
Date: Thu, 15 Sep 2022 11:47:12 +0200
Stefan Kangas <stefankangas <at> gmail.com> writes:

> Felix <felix.dick <at> web.de> writes:
>
>> I'm switching back and forth from Xorg to wayland and I'm
>> tinkering with different desktops/WMs anyways.
>> I would be happy to help!
>> I will try wallpaper.el with gnome tomorrow.
>> If there are any things you want me
>> to test, just let me know.
>
> Thank you!  That offer to help is much appreciated.
>
> I know next to nothing about Wayland, but any testing you could do with
> Gnome, KDE and Sway is welcome.  Or anything else you think might be
> useful and worth doing, really.

Neither swaybg nor wgb is running under gnome-shell with wayland.
Gnome has it's own way of setting wallpapers.
As kind of expected wbg depends on wlroots i guess.
I'm not shure how to check which wm/desktop is running.
wmctrl would be very usefull, but there is not garantee for it to be
installed.

Another point is that:
("gsettings" "set" "org.gnome.desktop.background" "picture-uri" "file://%f")
only effects the light scheme of gnome.
If you want to change the wallpaper of the dark scheme
("gsettings" "set" "org.gnome.desktop.background" "picture-uri-dark" "file://%f")
is the command.
'gsettings get org.gnome.desktop.interface color-scheme'
can be used to check which of both schemes is active.
It returns either 'prefer-dark' or 'prefer-light'
One could think about setting the wallpaper for both themes, or
only for the active color-scheme.

I can check KDE later, but I don't expect wgb or swaybg to work there.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#57781; Package emacs. (Thu, 15 Sep 2022 10:52:02 GMT) Full text and rfc822 format available.

Message #45 received at 57781 <at> debbugs.gnu.org (full text, mbox):

From: Felix <felix.dick <at> web.de>
To: Stefan Kangas <stefankangas <at> gmail.com>, Sean Whitton
 <spwhitton <at> spwhitton.name>, 57781 <at> debbugs.gnu.org
Subject: Re: bug#57781: missing wallpaper command
Date: Thu, 15 Sep 2022 12:37:52 +0200
Stefan Kangas <stefankangas <at> gmail.com> writes:

> Felix <felix.dick <at> web.de> writes:
>
>> I'm switching back and forth from Xorg to wayland and I'm
>> tinkering with different desktops/WMs anyways.
>> I would be happy to help!
>> I will try wallpaper.el with gnome tomorrow.
>> If there are any things you want me
>> to test, just let me know.
>
> Thank you!  That offer to help is much appreciated.
>
> I know next to nothing about Wayland, but any testing you could do with
> Gnome, KDE and Sway is welcome.  Or anything else you think might be
> useful and worth doing, really.

swaybg and wbg are starting a new instance each time wallpaper-set is
called. That means that if wallpaper-set is used more than once in an emacs session, multiple
wallpapers set.
In case of wallpaper applications that work like that, running instances
of wbg/swaybg should be terminated before loading new once.

with those "stand-alone" wallpaper applications, the wallpaper process
is attached to emacs if wallpaper-set is used.
With that the wallpaper only stays as long as emacs is running.
I think the process should be detached from emacs.

I'm not shure if that information is useful,
please let me know if it is, or if there is something i should test next.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#57781; Package emacs. (Fri, 16 Sep 2022 15:52:02 GMT) Full text and rfc822 format available.

Message #48 received at 57781 <at> debbugs.gnu.org (full text, mbox):

From: Thierry Volpiatto <thievol <at> posteo.net>
To: Stefan Kangas <stefankangas <at> gmail.com>
Cc: 57781 <at> debbugs.gnu.org, Felix <felix.dick <at> web.de>,
 Sean Whitton <spwhitton <at> spwhitton.name>
Subject: Re: bug#57781: missing wallpaper command
Date: Fri, 16 Sep 2022 15:50:56 +0000
Stefan Kangas <stefankangas <at> gmail.com> writes:

> Felix <felix.dick <at> web.de> writes:
>
>> I'm switching back and forth from Xorg to wayland and I'm
>> tinkering with different desktops/WMs anyways.
>> I would be happy to help!
>> I will try wallpaper.el with gnome tomorrow.
>> If there are any things you want me
>> to test, just let me know.
>
> Thank you!  That offer to help is much appreciated.
>
> I know next to nothing about Wayland, but any testing you could do with
> Gnome, KDE and Sway is welcome.  Or anything else you think might be
> useful and worth doing, really.

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))

-- 
Thierry




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#57781; Package emacs. (Fri, 16 Sep 2022 20:53:02 GMT) Full text and rfc822 format available.

Message #51 received at 57781 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefankangas <at> gmail.com>
To: Thierry Volpiatto <thievol <at> posteo.net>
Cc: 57781 <at> debbugs.gnu.org, Felix <felix.dick <at> web.de>,
 Sean Whitton <spwhitton <at> spwhitton.name>
Subject: Re: bug#57781: missing wallpaper command
Date: Fri, 16 Sep 2022 16:52:48 -0400
[Message part 1 (text/plain, inline)]
Thierry Volpiatto <thievol <at> 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?
[0001-Support-XFCE-in-wallpaper.el.patch (text/x-diff, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#57781; Package emacs. (Fri, 16 Sep 2022 21:10:01 GMT) Full text and rfc822 format available.

Message #54 received at 57781 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefankangas <at> gmail.com>
To: Felix <felix.dick <at> web.de>, Sean Whitton <spwhitton <at> spwhitton.name>,
 57781 <at> debbugs.gnu.org
Subject: Re: bug#57781: missing wallpaper command
Date: Fri, 16 Sep 2022 17:09:24 -0400
Felix <felix.dick <at> web.de> writes:

> Neither swaybg nor wgb is running under gnome-shell with wayland.
> Gnome has it's own way of setting wallpapers.
> As kind of expected wbg depends on wlroots i guess.
> I'm not shure how to check which wm/desktop is running.

Does that mean that setting the wallpaper using `wallpaper-set' doesn't
work when running gnome-shell under Wayland?

If you still have access to it, what is the value of the environment
variables $XDG_CURRENT_DESKTOP, $WAYLAND_DISPLAY and $SWAYSOCK in this
configuration?

If you like, perhaps you could send the output of the `env' command to
me privately.  Just edit out anything sensitive before sending it.

> wmctrl would be very usefull, but there is not garantee for it to be
> installed.

Thanks, I did not know about wmctrl.  I took a look at its website

    https://sites.google.com/site/tstyblo/wmctrl

but I could not find any way to set the wallpaper using it.  Maybe I
missed it.  Do you know if it can be done, and if so, how?

(We can check if it installed with `executable-find'.)

> Another point is that:
> ("gsettings" "set" "org.gnome.desktop.background" "picture-uri" "file://%f")
> only effects the light scheme of gnome.
> If you want to change the wallpaper of the dark scheme
> ("gsettings" "set" "org.gnome.desktop.background" "picture-uri-dark" "file://%f")
> is the command.
> 'gsettings get org.gnome.desktop.interface color-scheme'
> can be used to check which of both schemes is active.
> It returns either 'prefer-dark' or 'prefer-light'
> One could think about setting the wallpaper for both themes, or
> only for the active color-scheme.

Hmm, this is interesting.  It is clear that we need to extend
wallpaper.el to run another command first, to decide which command
should be run in various situations.  I will look into it.

> I can check KDE later, but I don't expect wgb or swaybg to work there.

That will be much appreciated.

Thanks for all of the above, this is very useful.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#57781; Package emacs. (Fri, 16 Sep 2022 21:10:02 GMT) Full text and rfc822 format available.

Message #57 received at 57781 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefankangas <at> gmail.com>
To: Felix <felix.dick <at> web.de>, Sean Whitton <spwhitton <at> spwhitton.name>,
 57781 <at> debbugs.gnu.org
Subject: Re: bug#57781: missing wallpaper command
Date: Fri, 16 Sep 2022 17:09:51 -0400
Felix <felix.dick <at> web.de> writes:

> swaybg and wbg are starting a new instance each time wallpaper-set is
> called. That means that if wallpaper-set is used more than once in an emacs session, multiple
> wallpapers set.
> In case of wallpaper applications that work like that, running instances
> of wbg/swaybg should be terminated before loading new once.
>
> with those "stand-alone" wallpaper applications, the wallpaper process
> is attached to emacs if wallpaper-set is used.
> With that the wallpaper only stays as long as emacs is running.
> I think the process should be detached from emacs.

Right, okay.  I will have to think about how to implement support for
this, because it's not something that wallpaper.el can currently handle.

> I'm not shure if that information is useful,
> please let me know if it is, or if there is something i should test next.

It is very useful, thanks!

You could take a look at my other email where I had some followup
questions.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#57781; Package emacs. (Sat, 17 Sep 2022 06:21:02 GMT) Full text and rfc822 format available.

Message #60 received at 57781 <at> debbugs.gnu.org (full text, mbox):

From: Thierry Volpiatto <thievol <at> posteo.net>
To: Stefan Kangas <stefankangas <at> gmail.com>
Cc: 57781 <at> debbugs.gnu.org, Felix <felix.dick <at> web.de>,
 Sean Whitton <spwhitton <at> spwhitton.name>
Subject: Re: bug#57781: missing wallpaper command
Date: Sat, 17 Sep 2022 06:14:11 +0000
[Message part 1 (text/plain, inline)]
Stefan Kangas <stefankangas <at> gmail.com> writes:

> Thierry Volpiatto <thievol <at> 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
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#57781; Package emacs. (Sat, 17 Sep 2022 12:33:01 GMT) Full text and rfc822 format available.

Message #63 received at 57781 <at> debbugs.gnu.org (full text, mbox):

From: Felix <felix.dick <at> web.de>
To: Stefan Kangas <stefankangas <at> gmail.com>, Sean Whitton
 <spwhitton <at> spwhitton.name>, 57781 <at> debbugs.gnu.org
Subject: Re: bug#57781: missing wallpaper command
Date: Sat, 17 Sep 2022 14:00:49 +0200
Stefan Kangas <stefankangas <at> gmail.com> writes:

> Felix <felix.dick <at> web.de> writes:
>
>> Neither swaybg nor wgb is running under gnome-shell with wayland.
>> Gnome has it's own way of setting wallpapers.
>> As kind of expected wbg depends on wlroots i guess.
>> I'm not shure how to check which wm/desktop is running.
>
> Does that mean that setting the wallpaper using `wallpaper-set' doesn't
> work when running gnome-shell under Wayland?

No it works under gnome-shell (if the light color scheme is active),
what i meant is that those wlroots dependend applications
(swaybg,wbg,hyprpaper ...)
are not working under gnome and probably not under kde.

>
> If you still have access to it, what is the value of the environment
> variables $XDG_CURRENT_DESKTOP, $WAYLAND_DISPLAY and $SWAYSOCK in this
> configuration?

On a fresh debian install with
- gnome-shell:
$XDG_CURRENT_DESKTOP is not set (i will check on arch linux later today)
$WAYLAND_DISPLAY = wayland-1
- sway:
$SWAYSOCK = /run/user/1000/sway-ipc.1000.13582.sock

>
> If you like, perhaps you could send the output of the `env' command to
> me privately.  Just edit out anything sensitive before sending it.
>

I will do that later today aswell.

>> wmctrl would be very usefull, but there is not garantee for it to be
>> installed.
>
> Thanks, I did not know about wmctrl.  I took a look at its website
>
>     https://sites.google.com/site/tstyblo/wmctrl
>
> but I could not find any way to set the wallpaper using it.  Maybe I
> missed it.  Do you know if it can be done, and if so, how?
>
> (We can check if it installed with `executable-find'.)
>

wmctrl is not for setting wallpapers, i meant that it would be a
convenient way to check which desktop/wm is running.

>> Another point is that:
>> ("gsettings" "set" "org.gnome.desktop.background" "picture-uri" "file://%f")
>> only effects the light scheme of gnome.
>> If you want to change the wallpaper of the dark scheme
>> ("gsettings" "set" "org.gnome.desktop.background" "picture-uri-dark" "file://%f")
>> is the command.
>> 'gsettings get org.gnome.desktop.interface color-scheme'
>> can be used to check which of both schemes is active.
>> It returns either 'prefer-dark' or 'prefer-light'
>> One could think about setting the wallpaper for both themes, or
>> only for the active color-scheme.
>
> Hmm, this is interesting.  It is clear that we need to extend
> wallpaper.el to run another command first, to decide which command
> should be run in various situations.  I will look into it.
>
>> I can check KDE later, but I don't expect wgb or swaybg to work there.

I'll include that later today (i'm on a train back home at the moment)

>
> That will be much appreciated.

>
> Thanks for all of the above, this is very useful.




bug No longer marked as fixed in versions 29.1 and reopened. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 17 Sep 2022 16:41:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#57781; Package emacs. (Sat, 17 Sep 2022 17:49:02 GMT) Full text and rfc822 format available.

Message #68 received at 57781 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefankangas <at> gmail.com>
To: Felix <felix.dick <at> web.de>, Sean Whitton <spwhitton <at> spwhitton.name>,
 57781 <at> debbugs.gnu.org
Subject: Re: bug#57781: missing wallpaper command
Date: Sat, 17 Sep 2022 13:48:22 -0400
Felix <felix.dick <at> web.de> writes:

> On a fresh debian install with
> - gnome-shell:
> $XDG_CURRENT_DESKTOP is not set (i will check on arch linux later today)

This is surprising to me.  But I guess that variable should be set by
something like "gdm"?  Is that what you used?

>> If you like, perhaps you could send the output of the `env' command to
>> me privately.  Just edit out anything sensitive before sending it.
>
> I will do that later today aswell.
[...]
>>> I can check KDE later, but I don't expect wgb or swaybg to work there.
>
> I'll include that later today (i'm on a train back home at the moment)

Excellent, thank you!




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#57781; Package emacs. (Sat, 17 Sep 2022 18:35:01 GMT) Full text and rfc822 format available.

Message #71 received at 57781 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefankangas <at> gmail.com>
To: Thierry Volpiatto <thievol <at> posteo.net>
Cc: 57781 <at> debbugs.gnu.org, Felix <felix.dick <at> web.de>,
 Sean Whitton <spwhitton <at> spwhitton.name>
Subject: Re: bug#57781: missing wallpaper command
Date: Sat, 17 Sep 2022 14:34:50 -0400
Thierry Volpiatto <thievol <at> posteo.net> writes:

> 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:

Hmm, maybe.  But shouldn't the default rather be something like
`ffap-file-at-point'?  Or maybe even

    (cons (ffap-file-at-point) wallpaper-last-used)

?

> 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)




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#57781; Package emacs. (Sun, 18 Sep 2022 03:44:01 GMT) Full text and rfc822 format available.

Message #74 received at 57781 <at> debbugs.gnu.org (full text, mbox):

From: Thierry Volpiatto <thievol <at> posteo.net>
To: Stefan Kangas <stefankangas <at> gmail.com>
Cc: 57781 <at> debbugs.gnu.org, Felix <felix.dick <at> web.de>,
 Sean Whitton <spwhitton <at> spwhitton.name>
Subject: Re: bug#57781: missing wallpaper command
Date: Sun, 18 Sep 2022 03:33:09 +0000
[Message part 1 (text/plain, inline)]
Stefan Kangas <stefankangas <at> gmail.com> writes:

> Thierry Volpiatto <thievol <at> posteo.net> writes:
>
>> 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:
>
> Hmm, maybe.  But shouldn't the default rather be something like
> `ffap-file-at-point'?  Or maybe even
>
>     (cons (ffap-file-at-point) wallpaper-last-used)

This assume you have an image at point, if not when cycling with M-n in
defaults the first M-n hit will show a non filename i.e. your current
buffer-file-name.

>> 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)


-- 
Thierry
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#57781; Package emacs. (Sun, 18 Sep 2022 11:27:01 GMT) Full text and rfc822 format available.

Message #77 received at 57781 <at> debbugs.gnu.org (full text, mbox):

From: Felix <felix.dick <at> web.de>
To: Stefan Kangas <stefankangas <at> gmail.com>
Cc: 57781 <at> debbugs.gnu.org, Sean Whitton <spwhitton <at> spwhitton.name>
Subject: Re: bug#57781: missing wallpaper command
Date: Sun, 18 Sep 2022 13:16:29 +0200
Stefan Kangas <stefankangas <at> gmail.com> writes:

> Felix <felix.dick <at> web.de> writes:
>
>> On a fresh debian install with
>> - gnome-shell:
>> $XDG_CURRENT_DESKTOP is not set (i will check on arch linux later today)
>
> This is surprising to me.  But I guess that variable should be set by
> something like "gdm"?  Is that what you used?
>

You are right! I'm kind of used to start things from tty.
Starting gnome with gdm:
$XDG_CURRENT_DESKTOP=GNOME
$DESKTOP_SESSION=gnome
Though it's not certain that everybody who uses gnome also uses gdm,
most of the time it will be the case i guess.


>>> If you like, perhaps you could send the output of the `env' command to
>>> me privately.  Just edit out anything sensitive before sending it.
>>
>> I will do that later today aswell.
> [...]
>>>> I can check KDE later, but I don't expect wgb or swaybg to work there.
>>
>> I'll include that later today (i'm on a train back home at the moment)
>
> Excellent, thank you!




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#57781; Package emacs. (Sun, 18 Sep 2022 22:28:01 GMT) Full text and rfc822 format available.

Message #80 received at 57781 <at> debbugs.gnu.org (full text, mbox):

From: Felix <felix.dick <at> web.de>
To: Stefan Kangas <stefankangas <at> gmail.com>
Cc: 57781 <at> debbugs.gnu.org, Sean Whitton <spwhitton <at> spwhitton.name>
Subject: Re: bug#57781: missing wallpaper command
Date: Mon, 19 Sep 2022 00:19:56 +0200
Stefan Kangas <stefankangas <at> gmail.com> writes:

> Felix <felix.dick <at> web.de> writes:
>
>> On a fresh debian install with
>> - gnome-shell:
>> $XDG_CURRENT_DESKTOP is not set (i will check on arch linux later today)
>
> This is surprising to me.  But I guess that variable should be set by
> something like "gdm"?  Is that what you used?
>
>>> If you like, perhaps you could send the output of the `env' command to
>>> me privately.  Just edit out anything sensitive before sending it.
>>
>> I will do that later today aswell.
> [...]
>>>> I can check KDE later, but I don't expect wgb or swaybg to work there.
>>
>> I'll include that later today (i'm on a train back home at the moment)
>
> Excellent, thank you!

On KDE/plasma Wayland everything i tested worked with wallpaper-set.
If wbg or swaybg is installed, they are used by wallpaper-set, which is
not optimal, if they are not installed kde's internal way of
setting the wallpaper is used. That way there is no process attached to
emacs, quiting emacs doesn't remove the wallpaper (as it does with wbg
or swaybg), and there is no need to kill old wallpaper processes.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#57781; Package emacs. (Mon, 19 Sep 2022 09:41:02 GMT) Full text and rfc822 format available.

Message #83 received at 57781 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefankangas <at> gmail.com>
To: Felix <felix.dick <at> web.de>
Cc: 57781 <at> debbugs.gnu.org, Sean Whitton <spwhitton <at> spwhitton.name>
Subject: Re: bug#57781: missing wallpaper command
Date: Mon, 19 Sep 2022 05:40:36 -0400
Felix <felix.dick <at> web.de> writes:

>> This is surprising to me.  But I guess that variable should be set by
>> something like "gdm"?  Is that what you used?
>
> You are right! I'm kind of used to start things from tty.
> Starting gnome with gdm:
> $XDG_CURRENT_DESKTOP=GNOME
> $DESKTOP_SESSION=gnome
> Though it's not certain that everybody who uses gnome also uses gdm,
> most of the time it will be the case i guess.

Yes, I think we will have to assume some kind of default configurations
here, and leave the more esoteric configurations to the tinkerers
themselves to figure out.  :-)




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#57781; Package emacs. (Mon, 19 Sep 2022 09:41:02 GMT) Full text and rfc822 format available.

Message #86 received at 57781 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefankangas <at> gmail.com>
To: Felix <felix.dick <at> web.de>
Cc: 57781 <at> debbugs.gnu.org, Sean Whitton <spwhitton <at> spwhitton.name>
Subject: Re: bug#57781: missing wallpaper command
Date: Mon, 19 Sep 2022 05:40:46 -0400
Felix <felix.dick <at> web.de> writes:

> On KDE/plasma Wayland everything i tested worked with wallpaper-set.
> If wbg or swaybg is installed, they are used by wallpaper-set, which is
> not optimal, if they are not installed kde's internal way of
> setting the wallpaper is used. That way there is no process attached to
> emacs, quiting emacs doesn't remove the wallpaper (as it does with wbg
> or swaybg), and there is no need to kill old wallpaper processes.

Thanks.  Based on your findings, I changed the priority so that the
desktop environment specific commands will be tried first.  I think that
should make more sense in most cases.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#57781; Package emacs. (Mon, 19 Sep 2022 17:29:01 GMT) Full text and rfc822 format available.

Message #89 received at 57781 <at> debbugs.gnu.org (full text, mbox):

From: Felix <felix.dick <at> web.de>
To: Stefan Kangas <stefankangas <at> gmail.com>
Cc: 57781 <at> debbugs.gnu.org, Sean Whitton <spwhitton <at> spwhitton.name>
Subject: Re: bug#57781: missing wallpaper command
Date: Mon, 19 Sep 2022 19:19:36 +0200
Stefan Kangas <stefankangas <at> gmail.com> writes:

> Felix <felix.dick <at> web.de> writes:
>
>> On KDE/plasma Wayland everything i tested worked with wallpaper-set.
>> If wbg or swaybg is installed, they are used by wallpaper-set, which is
>> not optimal, if they are not installed kde's internal way of
>> setting the wallpaper is used. That way there is no process attached to
>> emacs, quiting emacs doesn't remove the wallpaper (as it does with wbg
>> or swaybg), and there is no need to kill old wallpaper processes.
>
> Thanks.  Based on your findings, I changed the priority so that the
> desktop environment specific commands will be tried first.  I think that
> should make more sense in most cases.

In my private config i prepend the wallpaper-command with "setsid",
that way the process isn't attached to emacs and the wallpaper set by
wbg or swaybg will stay after closing emacs.
This is an Linux specific thing of course.
I'm not shure how it works for gnome and plasma, but i would think it
makes no difference.
Maybe that's to hacky for including it, but i thought i'll mention it anyways.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#57781; Package emacs. (Mon, 19 Sep 2022 19:17:02 GMT) Full text and rfc822 format available.

Message #92 received at 57781 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefankangas <at> gmail.com>
To: Felix <felix.dick <at> web.de>
Cc: 57781 <at> debbugs.gnu.org, Sean Whitton <spwhitton <at> spwhitton.name>
Subject: Re: bug#57781: missing wallpaper command
Date: Mon, 19 Sep 2022 15:16:36 -0400
Felix <felix.dick <at> web.de> writes:

> In my private config i prepend the wallpaper-command with "setsid",
> that way the process isn't attached to emacs and the wallpaper set by
> wbg or swaybg will stay after closing emacs.
> This is an Linux specific thing of course.

The command handling is already only relevant for Unix-like systems:
MS-Windows and Haiku use native APIs.  I'm not yet sure how to best
handle the above in wallpaper.el, but I'm looking into it.

I guess we could use "setsid", but in that case we might as well use
"nohup" as that command is mandated to be there by POSIX.  (AFAIU, on
FreeBSD you'd need to install the "util-linux" package to get setsid.)

> I'm not shure how it works for gnome and plasma, but i would think it
> makes no difference.

From your testing, it seems like it works without it, right?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#57781; Package emacs. (Mon, 19 Sep 2022 19:33:02 GMT) Full text and rfc822 format available.

Message #95 received at 57781 <at> debbugs.gnu.org (full text, mbox):

From: Felix <felix.dick <at> web.de>
To: Stefan Kangas <stefankangas <at> gmail.com>
Cc: 57781 <at> debbugs.gnu.org, Sean Whitton <spwhitton <at> spwhitton.name>
Subject: Re: bug#57781: missing wallpaper command
Date: Mon, 19 Sep 2022 21:26:02 +0200
Stefan Kangas <stefankangas <at> gmail.com> writes:

> Felix <felix.dick <at> web.de> writes:
>
>> In my private config i prepend the wallpaper-command with "setsid",
>> that way the process isn't attached to emacs and the wallpaper set by
>> wbg or swaybg will stay after closing emacs.
>> This is an Linux specific thing of course.
>
> The command handling is already only relevant for Unix-like systems:
> MS-Windows and Haiku use native APIs.  I'm not yet sure how to best
> handle the above in wallpaper.el, but I'm looking into it.
>
> I guess we could use "setsid", but in that case we might as well use
> "nohup" as that command is mandated to be there by POSIX.  (AFAIU, on
> FreeBSD you'd need to install the "util-linux" package to get setsid.)
>
>> I'm not shure how it works for gnome and plasma, but i would think it
>> makes no difference.
>
> From your testing, it seems like it works without it, right?

I don't really know what i'm doing, but
i found that it works if i replace the start-process call with:

(apply #'call-process
                wallpaper-command
                nil 0 nil
                (mapcar (lambda (arg) (format-spec arg fmt-spec))
                wallpaper-command-args))




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#57781; Package emacs. (Mon, 19 Sep 2022 20:08:01 GMT) Full text and rfc822 format available.

Message #98 received at 57781 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefankangas <at> gmail.com>
To: Felix <felix.dick <at> web.de>
Cc: 57781 <at> debbugs.gnu.org, Sean Whitton <spwhitton <at> spwhitton.name>
Subject: Re: bug#57781: missing wallpaper command
Date: Mon, 19 Sep 2022 16:07:17 -0400
Felix <felix.dick <at> web.de> writes:

> I don't really know what i'm doing, but
> i found that it works if i replace the start-process call with:

I'm not sure I follow.  Could you explain what wasn't working before
this change, and what started working with it?  Are we talking about
setting the wallpaper in KDE Plasma and Gnome, or something else?

> (apply #'call-process
>                 wallpaper-command
>                 nil 0 nil
>                 (mapcar (lambda (arg) (format-spec arg fmt-spec))
>                 wallpaper-command-args))

Thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#57781; Package emacs. (Mon, 19 Sep 2022 21:10:01 GMT) Full text and rfc822 format available.

Message #101 received at 57781 <at> debbugs.gnu.org (full text, mbox):

From: Felix <felix.dick <at> web.de>
To: Stefan Kangas <stefankangas <at> gmail.com>
Cc: 57781 <at> debbugs.gnu.org, Sean Whitton <spwhitton <at> spwhitton.name>
Subject: Re: bug#57781: missing wallpaper command
Date: Mon, 19 Sep 2022 23:04:56 +0200
Stefan Kangas <stefankangas <at> gmail.com> writes:

> Felix <felix.dick <at> web.de> writes:
>
>> I don't really know what i'm doing, but
>> i found that it works if i replace the start-process call with:
>
> I'm not sure I follow.  Could you explain what wasn't working before
> this change, and what started working with it?  Are we talking about
> setting the wallpaper in KDE Plasma and Gnome, or something else?
>
>> (apply #'call-process
>>                 wallpaper-command
>>                 nil 0 nil
>>                 (mapcar (lambda (arg) (format-spec arg fmt-spec))
>>                 wallpaper-command-args))
>
> Thanks.

That way the process is not attached to emacs.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#57781; Package emacs. (Tue, 04 Oct 2022 05:59:02 GMT) Full text and rfc822 format available.

Message #104 received at 57781 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefankangas <at> gmail.com>
To: Felix <felix.dick <at> web.de>
Cc: 57781 <at> debbugs.gnu.org, Sean Whitton <spwhitton <at> spwhitton.name>
Subject: Re: bug#57781: missing wallpaper command
Date: Tue, 4 Oct 2022 07:58:48 +0200
[Message part 1 (text/plain, inline)]
Felix <felix.dick <at> web.de> writes:

> I'm switching back and forth from Xorg to wayland and I'm
> tinkering with different desktops/WMs anyways.
> I would be happy to help!
> I will try wallpaper.el with gnome tomorrow.
> If there are any things you want me
> to test, just let me know.

I believe the attached patch will fix setting the wallpaper using
swaybg/wbg.  It will prompt to kill any existing swaybg/wbg processes,
and start a new process that should survive exiting Emacs.

I would appreciate any help with testing it.
[0001-Fix-setting-the-wallpaper-with-swaybg-and-wbg.patch (text/x-diff, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#57781; Package emacs. (Fri, 07 Oct 2022 09:09:02 GMT) Full text and rfc822 format available.

Message #107 received at 57781 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefankangas <at> gmail.com>
To: Felix <felix.dick <at> web.de>
Cc: 57781 <at> debbugs.gnu.org, Sean Whitton <spwhitton <at> spwhitton.name>
Subject: Re: bug#57781: missing wallpaper command
Date: Fri, 7 Oct 2022 11:08:05 +0200
[Please use "Reply to all" so that the discussion
 is recorded in the bug tracker.]

Felix <felix.dick <at> web.de> writes:

>> [2. text/x-diff; 0001-Fix-setting-the-wallpaper-with-swaybg-and-wbg.patch]...
>
> It doesn't work on my side.
> Here is the debug log
>
> Debugger entered--Lisp error: (wrong-type-argument numberp nil)
>   number-to-string(nil)
>   (and (fboundp 'x-window-property) (display-graphic-p) (number-to-string (or (x-window-property "_NET_CURRENT_DESKTOP" nil "CARDINAL" 0 nil t) (x-window-property "WIN_WORKSPACE" nil "CARDINAL" 0 nil t))))
>   (or (and (fboundp 'x-window-property) (display-graphic-p) (number-to-string (or (x-window-property "_NET_CURRENT_DESKTOP" nil "CARDINAL" 0 nil t) (x-window-property "WIN_WORKSPACE" nil "CARDINAL" 0 nil t)))) "0")
>   (cons 87 (or (and (fboundp 'x-window-property) (display-graphic-p) (number-to-string (or (x-window-property "_NET_CURRENT_DESKTOP" nil "CARDINAL" 0 nil t) (x-window-property "WIN_WORKSPACE" nil "CARDINAL" 0 nil t)))) "0"))
>   (list (cons 102 (expand-file-name file)) (cons 70 (mapconcat #'url-hexify-string (file-name-split file) "/")) (cons 104 #'(lambda nil (wallpaper--get-height-or-width "height" #'display-pixel-height wallpaper-default-height))) (cons 119 #'(lambda nil (wallpaper--get-height-or-width "width" #'display-pixel-width wallpaper-default-width))) (cons 83 (let ((display (frame-parameter (selected-frame) 'display))) (if (and display (string-match ":[0-9]+\\.\\([0-9]+\\)\\'" display)) (match-string 1 display) "0"))) (cons 77 #'wallpaper--x-monitor-name) (cons 87 (or (and (fboundp 'x-window-property) (display-graphic-p) (number-to-string (or (x-window-property "_NET_CURRENT_DESKTOP" nil "CARDINAL" 0 nil t) (x-window-property "WIN_WORKSPACE" nil "CARDINAL" 0 nil t)))) "0")))
>   (format-spec format (list (cons 102 (expand-file-name file)) (cons 70 (mapconcat #'url-hexify-string (file-name-split file) "/")) (cons 104 #'(lambda nil (wallpaper--get-height-or-width "height" #'display-pixel-height wallpaper-default-height))) (cons 119 #'(lambda nil (wallpaper--get-height-or-width "width" #'display-pixel-width wallpaper-default-width))) (cons 83 (let ((display (frame-parameter (selected-frame) 'display))) (if (and display (string-match ":[0-9]+\\.\\([0-9]+\\)\\'" display)) (match-string 1 display) "0"))) (cons 77 #'wallpaper--x-monitor-name) (cons 87 (or (and (fboundp 'x-window-property) (display-graphic-p) (number-to-string (or (x-window-property "_NET_CURRENT_DESKTOP" nil "CARDINAL" 0 nil t) (x-window-property "WIN_WORKSPACE" nil "CARDINAL" 0 nil t)))) "0"))))
>   wallpaper--format-arg("%f" "~/wallpapers/bloom.jpg")
>   (closure ((args "%f") (file . "~/wallpapers/bloom.jpg") cl-struct-wallpaper-setter-tags t) (arg) (wallpaper--format-arg arg file))("%f")
>   mapcar((closure ((args "%f") (file . "~/wallpapers/bloom.jpg") cl-struct-wallpaper-setter-tags t) (arg) (wallpaper--format-arg arg file)) ("%f"))
>   (let* ((args (if (functionp wallpaper-command-args) (funcall wallpaper-command-args) wallpaper-command-args)) (real-args (mapcar #'(lambda (arg) (wallpaper--format-arg arg file)) args)) (bufname (format " *wallpaper-%s*" (random))) (setter (and (progn (and (memq (type-of wallpaper--current-setter) cl-struct-wallpaper-setter-tags) t)) (equal (progn (or (progn ...) (signal ... ...)) (aref wallpaper--current-setter 2)) wallpaper-command) wallpaper--current-setter)) (init-action (and setter (progn (or (progn (and ... t)) (signal 'wrong-type-argument (list ... setter))) (aref setter 5)))) (detach (and setter (progn (or (progn (and ... t)) (signal 'wrong-type-argument (list ... setter))) (aref setter 6)))) process) (if init-action (progn (funcall init-action))) (wallpaper-debug "Using command: \"%s %s\"" wallpaper-command (string-join real-args " ")) (if detach (apply #'call-process wallpaper-command nil 0 nil real-args) (setq process (apply #'start-process "set-wallpaper" bufname wallpaper-command real-args)) (let* ((v process)) (set-process-sentinel v #'(lambda (process status) (unwind-protect (if ... ... ...) (condition-case nil ... ...)))))) process)
>   wallpaper-default-set-function("~/wallpapers/bloom.jpg")
>   funcall(wallpaper-default-set-function "~/wallpapers/bloom.jpg")
>   wallpaper-set("~/wallpapers/bloom.jpg")
>   (progn (wallpaper-set "~/wallpapers/bloom.jpg"))

Thanks.  This error was unrelated to the patch, but should now be fixed
on the master branch (commit 55bd6a5cd4).  Could you please pull latest
master, re-apply the patch, and then try again?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#57781; Package emacs. (Fri, 07 Oct 2022 19:59:02 GMT) Full text and rfc822 format available.

Message #110 received at 57781 <at> debbugs.gnu.org (full text, mbox):

From: Felix <felix.dick <at> web.de>
To: Stefan Kangas <stefankangas <at> gmail.com>
Cc: 57781 <at> debbugs.gnu.org, Sean Whitton <spwhitton <at> spwhitton.name>
Subject: Re: bug#57781: missing wallpaper command
Date: Fri, 07 Oct 2022 21:55:13 +0200
Stefan Kangas <stefankangas <at> gmail.com> writes:

> [Please use "Reply to all" so that the discussion
>  is recorded in the bug tracker.]
>
> Felix <felix.dick <at> web.de> writes:
>
>>> [2. text/x-diff; 0001-Fix-setting-the-wallpaper-with-swaybg-and-wbg.patch]...
>>
>> It doesn't work on my side.
>> Here is the debug log
>>
>> Debugger entered--Lisp error: (wrong-type-argument numberp nil)
>>   number-to-string(nil)
>>   (and (fboundp 'x-window-property) (display-graphic-p) (number-to-string (or (x-window-property "_NET_CURRENT_DESKTOP" nil "CARDINAL" 0 nil t) (x-window-property "WIN_WORKSPACE" nil "CARDINAL" 0 nil t))))
>>   (or (and (fboundp 'x-window-property) (display-graphic-p) (number-to-string (or (x-window-property "_NET_CURRENT_DESKTOP" nil "CARDINAL" 0 nil t) (x-window-property "WIN_WORKSPACE" nil "CARDINAL" 0 nil t)))) "0")
>>   (cons 87 (or (and (fboundp 'x-window-property) (display-graphic-p) (number-to-string (or (x-window-property "_NET_CURRENT_DESKTOP" nil "CARDINAL" 0 nil t) (x-window-property "WIN_WORKSPACE" nil "CARDINAL" 0 nil t)))) "0"))
>>   (list (cons 102 (expand-file-name file)) (cons 70 (mapconcat #'url-hexify-string (file-name-split file) "/")) (cons 104 #'(lambda nil (wallpaper--get-height-or-width "height" #'display-pixel-height wallpaper-default-height))) (cons 119 #'(lambda nil (wallpaper--get-height-or-width "width" #'display-pixel-width wallpaper-default-width))) (cons 83 (let ((display (frame-parameter (selected-frame) 'display))) (if (and display (string-match ":[0-9]+\\.\\([0-9]+\\)\\'" display)) (match-string 1 display) "0"))) (cons 77 #'wallpaper--x-monitor-name) (cons 87 (or (and (fboundp 'x-window-property) (display-graphic-p) (number-to-string (or (x-window-property "_NET_CURRENT_DESKTOP" nil "CARDINAL" 0 nil t) (x-window-property "WIN_WORKSPACE" nil "CARDINAL" 0 nil t)))) "0")))
>>   (format-spec format (list (cons 102 (expand-file-name file)) (cons 70 (mapconcat #'url-hexify-string (file-name-split file) "/")) (cons 104 #'(lambda nil (wallpaper--get-height-or-width "height" #'display-pixel-height wallpaper-default-height))) (cons 119 #'(lambda nil (wallpaper--get-height-or-width "width" #'display-pixel-width wallpaper-default-width))) (cons 83 (let ((display (frame-parameter (selected-frame) 'display))) (if (and display (string-match ":[0-9]+\\.\\([0-9]+\\)\\'" display)) (match-string 1 display) "0"))) (cons 77 #'wallpaper--x-monitor-name) (cons 87 (or (and (fboundp 'x-window-property) (display-graphic-p) (number-to-string (or (x-window-property "_NET_CURRENT_DESKTOP" nil "CARDINAL" 0 nil t) (x-window-property "WIN_WORKSPACE" nil "CARDINAL" 0 nil t)))) "0"))))
>>   wallpaper--format-arg("%f" "~/wallpapers/bloom.jpg")
>>   (closure ((args "%f") (file . "~/wallpapers/bloom.jpg") cl-struct-wallpaper-setter-tags t) (arg) (wallpaper--format-arg arg file))("%f")
>>   mapcar((closure ((args "%f") (file . "~/wallpapers/bloom.jpg") cl-struct-wallpaper-setter-tags t) (arg) (wallpaper--format-arg arg file)) ("%f"))
>>   (let* ((args (if (functionp wallpaper-command-args) (funcall wallpaper-command-args) wallpaper-command-args)) (real-args (mapcar #'(lambda (arg) (wallpaper--format-arg arg file)) args)) (bufname (format " *wallpaper-%s*" (random))) (setter (and (progn (and (memq (type-of wallpaper--current-setter) cl-struct-wallpaper-setter-tags) t)) (equal (progn (or (progn ...) (signal ... ...)) (aref wallpaper--current-setter 2)) wallpaper-command) wallpaper--current-setter)) (init-action (and setter (progn (or (progn (and ... t)) (signal 'wrong-type-argument (list ... setter))) (aref setter 5)))) (detach (and setter (progn (or (progn (and ... t)) (signal 'wrong-type-argument (list ... setter))) (aref setter 6)))) process) (if init-action (progn (funcall init-action))) (wallpaper-debug "Using command: \"%s %s\"" wallpaper-command (string-join real-args " ")) (if detach (apply #'call-process wallpaper-command nil 0 nil real-args) (setq process (apply #'start-process "set-wallpaper" bufname wallpaper-command real-args)) (let* ((v process)) (set-process-sentinel v #'(lambda (process status) (unwind-protect (if ... ... ...) (condition-case nil ... ...)))))) process)
>>   wallpaper-default-set-function("~/wallpapers/bloom.jpg")
>>   funcall(wallpaper-default-set-function "~/wallpapers/bloom.jpg")
>>   wallpaper-set("~/wallpapers/bloom.jpg")
>>   (progn (wallpaper-set "~/wallpapers/bloom.jpg"))
>
> Thanks.  This error was unrelated to the patch, but should now be fixed
> on the master branch (commit 55bd6a5cd4).  Could you please pull latest
> master, re-apply the patch, and then try again?

Now it works!
Nice one!




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#57781; Package emacs. (Fri, 07 Oct 2022 20:17:01 GMT) Full text and rfc822 format available.

Message #113 received at 57781 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefankangas <at> gmail.com>
To: Felix <felix.dick <at> web.de>
Cc: 57781 <at> debbugs.gnu.org, Sean Whitton <spwhitton <at> spwhitton.name>
Subject: Re: bug#57781: missing wallpaper command
Date: Fri, 7 Oct 2022 22:16:30 +0200
close 57781 29.1
thanks

Felix <felix.dick <at> web.de> writes:

> Now it works!
> Nice one!

Great!  Thanks for testing, I've pushed this to master (commit
5e83c0117e).  I'm consequently closing this bug report.

If you find any more issues, please open a new bug report.




bug marked as fixed in version 29.1, send any further explanations to 57781 <at> debbugs.gnu.org and Felix <felix.dick <at> web.de> Request was from Stefan Kangas <stefankangas <at> gmail.com> to control <at> debbugs.gnu.org. (Fri, 07 Oct 2022 20:17:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 05 Nov 2022 11:24:10 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 144 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.