From: Thierry Volpiatto <thievol@posteo.net>
To: Po Lu <luangruo@yahoo.com>
Cc: Stefan Kangas <stefankangas@gmail.com>, emacs-devel@gnu.org
Subject: Re: master fe7c015b20: Support XFCE in wallpaper.el
Date: Mon, 19 Sep 2022 06:06:38 +0000 [thread overview]
Message-ID: <87tu53c28w.fsf@posteo.net> (raw)
In-Reply-To: <87leqgrmtb.fsf@yahoo.com>
[-- Attachment #1: Type: text/plain, Size: 4075 bytes --]
Po Lu <luangruo@yahoo.com> writes:
> Thierry Volpiatto <thievol@posteo.net> writes:
>
>> Po Lu <luangruo@yahoo.com> writes:
>>
>>> Thierry Volpiatto <thievol@posteo.net> writes:
>>>
>>>> Here the command fails if you specify the workspace, it works only with
>>>> "worspace0".
>>>
>>> But that's because you only have workspace 1 displayed, right?
>>
>> No, if emacs is on workspace0 and I use:
>> "/backdrop/screen0/monitoreDP/workspace0/last-image"
>> wallpaper is modified as expected.
>>
>> Then if emacs is on workspace2 and I use:
>> "/backdrop/screen0/monitoreDP/workspace2/last-image"
>> Command exit with 0 status but wallpaper is not modified, but if I use:
>> "/backdrop/screen0/monitoreDP/workspace0/last-image" again (always from
>> workspace2), wallpaper is modified as expected.
>>
>> I can verify this with this command which monitor the desktop change:
>>
>> xfconf-query -c xfce4-desktop -m
>>
>> => Commencer à surveiller le canal « xfce4-desktop » :
>>
>> then I go to workspace4, modify wallpaper with mouse and the usual xfce
>> interface for this, go back in workspace1 an look at output:
>> I have now:
>>
>> Commencer à surveiller le canal « xfce4-desktop » :
>>
>> définir: /backdrop/screen0/monitoreDP/workspace0/last-image
>>
>> unfortunately this command is interactive :-(
>
> But here is how Thunar, the XFCE file manager, sets the backdrop:
>
> image_path_prop = g_strdup_printf("/backdrop/screen%d/monitor%s/workspace%d/last-image", screen_nr, monitor_name, workspace);
> image_style_prop = g_strdup_printf("/backdrop/screen%d/monitor%s/workspace%d/image-style", screen_nr, monitor_name, workspace);
Yes, sure it is working from thunar. But here from emacs with
it specified, the command output with 0 but the background is not
changed unless I hardcode workspace to 0.
Here the function used with its Edebug
output:
(defun tv/change-xfce-background (file)
(let* ((screen (frame-parameter (selected-frame) 'display))
(monitor (assoc-default 'name (car (display-monitor-attributes-list))))
(desktop (x-window-property "_NET_CURRENT_DESKTOP" nil "CARDINAL" 0 nil t))
(prop (format "/backdrop/screen%s/monitor%s/workspace%s/last-image"
(substring screen (1- (length screen)))
monitor
desktop
)))
(if (= (apply #'call-process "xfconf-query" nil nil nil
`("-c" "xfce4-desktop" "-p" ,prop "-s" ,file))
0)
(message "Background changed successfully to %s" (helm-basename file))
(message "Failed to change background"))))
Edebug: tv/change-xfce-background
tv/change-xfce-background
Result: #<frame *scratch* - GNU Emacs at IPad-S340 0x55d297d580f8>
Result: ":0.0"
Result: (((name . "eDP") (geometry 0 0 1920 1080) (workarea 0 0 1920 1080) (mm-size 309 174) (frames #<frame *scratch* - GNU Emacs at IPad-S340 0x55d297d580f8>) (source . "XRandr")))
Result: ((name . "eDP") (geometry 0 0 1920 1080) (workarea 0 0 1920 1080) (mm-size 309 174) (frames #<frame *scratch* - GNU Emacs at IPad-S340 0x55d297d580f8>) (source . "XRandr"))
Result: "eDP"
Result: 2 (#o2, #x2, ?\C-b)
Result: ":0.0"
Result: ":0.0"
Result: 4 (#o4, #x4, ?\C-d)
Result: 3 (#o3, #x3, ?\C-c)
Result: "0"
Result: "eDP"
Result: 2 (#o2, #x2, ?\C-b)
Result: "/backdrop/screen0/monitoreDP/workspace2/last-image"
Result: call-process
Result: "/backdrop/screen0/monitoreDP/workspace2/last-image"
Result: "/home/thierry/backgrounds/Cyclosys.jpg"
Result: ("-c" "xfce4-desktop" "-p" "/backdrop/screen0/monitoreDP/workspace2/last-image" "-s" "/home/thierry/backgrounds/Cyclosys.jpg")
Result: 0 (#o0, #x0, ?\C-@)
Result: t
Result: "/home/thierry/backgrounds/Cyclosys.jpg"
Result: "Cyclosys.jpg"
Background changed successfully to Cyclosys.jpg
Result: "Background changed successfully to Cyclosys.jpg"
--
Thierry
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 686 bytes --]
next prev parent reply other threads:[~2022-09-19 6:06 UTC|newest]
Thread overview: 61+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <166336105908.23797.12319380359602540227@vcs2.savannah.gnu.org>
[not found] ` <20220916204419.B124FC00872@vcs2.savannah.gnu.org>
2022-09-17 2:00 ` master fe7c015b20: Support XFCE in wallpaper.el Po Lu
2022-09-17 18:03 ` Stefan Kangas
2022-09-18 1:18 ` Po Lu
2022-09-18 2:13 ` Po Lu
2022-09-18 4:48 ` Thierry Volpiatto
2022-09-18 5:15 ` Po Lu
2022-09-18 14:44 ` Thierry Volpiatto
2022-09-19 4:49 ` Po Lu
2022-09-19 6:06 ` Thierry Volpiatto [this message]
2022-09-19 7:24 ` Po Lu
2022-09-19 8:40 ` Thierry Volpiatto
2022-09-19 8:52 ` Po Lu
2022-09-19 17:46 ` Thierry Volpiatto
2022-09-19 18:05 ` Thierry Volpiatto
2022-09-19 18:59 ` Stefan Kangas
2022-09-19 20:16 ` Tomas Hlavaty
2022-09-19 21:19 ` Stefan Monnier
2022-09-20 6:16 ` Thierry Volpiatto
2022-09-20 2:32 ` Eli Zaretskii
2022-09-20 2:43 ` Po Lu
2022-09-20 6:25 ` Thierry Volpiatto
2022-09-20 8:22 ` Po Lu
2022-09-19 7:23 ` Thierry Volpiatto
2022-09-26 19:42 ` Stefan Kangas
2022-09-26 21:01 ` Stephen Berman
2022-09-26 22:46 ` Stefan Kangas
2022-09-27 7:17 ` Stephen Berman
2022-09-27 7:45 ` Po Lu
2022-09-27 13:42 ` Stefan Kangas
2022-09-27 0:33 ` Po Lu
2022-09-27 5:56 ` Eli Zaretskii
2022-09-27 6:13 ` Po Lu
2022-09-27 6:45 ` Eli Zaretskii
2022-09-27 7:50 ` Po Lu
2022-09-27 7:56 ` Eli Zaretskii
2022-09-27 8:31 ` Po Lu
2022-09-27 7:21 ` Thierry Volpiatto
2022-09-27 7:42 ` Po Lu
2022-09-27 7:55 ` Thierry Volpiatto
2022-09-27 8:35 ` Po Lu
2022-09-27 18:33 ` Stefan Kangas
2022-09-28 0:34 ` Po Lu
2022-09-27 13:57 ` Stefan Kangas
2022-09-27 15:43 ` Visuwesh
2022-09-27 16:19 ` Stefan Kangas
2022-09-27 16:39 ` Thierry Volpiatto
2022-09-27 16:40 ` Eli Zaretskii
2022-09-27 17:01 ` Stefan Kangas
2022-09-27 17:14 ` Eli Zaretskii
2022-09-27 18:02 ` Make format-spec accept a function as the substitution Stefan Kangas
2022-09-29 6:57 ` Thierry Volpiatto
2022-09-29 12:36 ` Stefan Monnier
2022-09-29 12:59 ` Stefan Kangas
2022-09-29 15:02 ` Philip Kaludercic
2022-09-29 16:34 ` Stefan Kangas
2022-09-29 16:53 ` Philip Kaludercic
2022-09-29 17:06 ` Stefan Kangas
2022-09-29 16:56 ` Stefan Monnier
2022-09-29 15:09 ` Thierry Volpiatto
2022-09-29 16:34 ` Stefan Kangas
2022-09-29 14:16 ` master fe7c015b20: Support XFCE in wallpaper.el 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=87tu53c28w.fsf@posteo.net \
--to=thievol@posteo.net \
--cc=emacs-devel@gnu.org \
--cc=luangruo@yahoo.com \
--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).