unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Re: master f25f4699d7 2/2: Support several new DEs in wallpaper.el
       [not found] ` <20220923012800.2B4E1C12D97@vcs2.savannah.gnu.org>
@ 2022-09-23  4:52   ` Po Lu
  2022-09-23  6:16     ` Eli Zaretskii
  2022-09-23 11:15     ` Stefan Kangas
  0 siblings, 2 replies; 8+ messages in thread
From: Po Lu @ 2022-09-23  4:52 UTC (permalink / raw)
  To: emacs-devel; +Cc: Stefan Kangas

Stefan Kangas <stefankangas@gmail.com> writes:

> branch: master
> commit f25f4699d760c5409a1571dcfdf4ed0fdac9e0ec
> Author: Stefan Kangas <stefankangas@gmail.com>
> Commit: Stefan Kangas <stefankangas@gmail.com>
>
>     Support several new DEs in wallpaper.el
>     
>     * lisp/image/wallpaper.el (wallpaper--default-commands)
>     (wallpaper--check-command, wallpaper-command): Add support for Unity,
>     Pantheon, Budgie, LXQt, and LXDE.  Also add support for Lubuntu,
>     Xubuntu, and Pop!_OS.
> ---
>  lisp/image/wallpaper.el | 43 +++++++++++++++++++++++++++++++++++++++++--
>  1 file changed, 41 insertions(+), 2 deletions(-)
>
> diff --git a/lisp/image/wallpaper.el b/lisp/image/wallpaper.el
> index ff47d37e3a..effa25b180 100644
> --- a/lisp/image/wallpaper.el
> +++ b/lisp/image/wallpaper.el
> @@ -62,6 +62,16 @@
>      ;; XFCE
>      ("xfconf-query" "-c" "xfce4-desktop" "-p"
>       "/backdrop/screen0/monitoreDP/workspace0/last-image" "-s" "%f")
> +    ;; LXDE
> +    ("pcmanfm" "--set-wallpaper=%f")
> +    ;; LXQt
> +    ("pcmanfm-qt" "--set-wallpaper=%f") ; "--wallpaper-mode=MODE"
> +    ;; ;; Mate
> +    ;; ("gsettings" "set" "org.mate.background" "picture-filename" "%f")
> +    ;; ;; Cinnamon
> +    ;; ("gsettings" "set" "org.cinnamon.desktop.background" "picture-uri" "file://%f")
> +    ;; ;; Deepin
> +    ;; ("gsettings" "set" "com.deepin.wrap.gnome.desktop.background" "picture-uri" "file://%f")

BTW, did you test the file://%f commands with file names containing
spaces and/or Unicode to make sure they indeed do not have to be
encoded?



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: master f25f4699d7 2/2: Support several new DEs in wallpaper.el
  2022-09-23  4:52   ` master f25f4699d7 2/2: Support several new DEs in wallpaper.el Po Lu
@ 2022-09-23  6:16     ` Eli Zaretskii
  2022-09-23  6:22       ` Po Lu
  2022-09-23 11:15     ` Stefan Kangas
  1 sibling, 1 reply; 8+ messages in thread
From: Eli Zaretskii @ 2022-09-23  6:16 UTC (permalink / raw)
  To: Po Lu; +Cc: emacs-devel, stefankangas

> From: Po Lu <luangruo@yahoo.com>
> Cc: Stefan Kangas <stefankangas@gmail.com>
> Date: Fri, 23 Sep 2022 12:52:10 +0800
> 
> BTW, did you test the file://%f commands with file names containing
> spaces and/or Unicode to make sure they indeed do not have to be
> encoded?

What kind of encoding did you have in mind in this case? IDNA?
url-hexlify? something else?



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: master f25f4699d7 2/2: Support several new DEs in wallpaper.el
  2022-09-23  6:16     ` Eli Zaretskii
@ 2022-09-23  6:22       ` Po Lu
  0 siblings, 0 replies; 8+ messages in thread
From: Po Lu @ 2022-09-23  6:22 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel, stefankangas

Eli Zaretskii <eliz@gnu.org> writes:

> What kind of encoding did you have in mind in this case? IDNA?
> url-hexlify? something else?

url-hexify-string, which is what I think most GNOME-based desktops want.



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: master f25f4699d7 2/2: Support several new DEs in wallpaper.el
  2022-09-23  4:52   ` master f25f4699d7 2/2: Support several new DEs in wallpaper.el Po Lu
  2022-09-23  6:16     ` Eli Zaretskii
@ 2022-09-23 11:15     ` Stefan Kangas
  2022-09-23 12:02       ` Po Lu
  2022-09-23 13:20       ` Yuri Khan
  1 sibling, 2 replies; 8+ messages in thread
From: Stefan Kangas @ 2022-09-23 11:15 UTC (permalink / raw)
  To: Po Lu; +Cc: emacs-devel

Po Lu <luangruo@yahoo.com> writes:

> BTW, did you test the file://%f commands with file names containing
> spaces and/or Unicode to make sure they indeed do not have to be
> encoded?

I did not test that, no.  For now, this is more based on searching for
recipes online rather than testing, unfortunately.

Do you have reason to think that they would need to be encoded?  My
findings so far would suggest that either they don't, or that a lot of
people are getting this wrong.



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: master f25f4699d7 2/2: Support several new DEs in wallpaper.el
  2022-09-23 11:15     ` Stefan Kangas
@ 2022-09-23 12:02       ` Po Lu
  2022-09-23 13:06         ` Stefan Kangas
  2022-09-23 13:20       ` Yuri Khan
  1 sibling, 1 reply; 8+ messages in thread
From: Po Lu @ 2022-09-23 12:02 UTC (permalink / raw)
  To: Stefan Kangas; +Cc: emacs-devel

Stefan Kangas <stefankangas@gmail.com> writes:

> I did not test that, no.  For now, this is more based on searching for
> recipes online rather than testing, unfortunately.
>
> Do you have reason to think that they would need to be encoded?  My
> findings so far would suggest that either they don't, or that a lot of
> people are getting this wrong.

Only that they are encoded on my system running GNOME Shell:

  file:///usr/local/share/backgrounds/Simple%20white.png



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: master f25f4699d7 2/2: Support several new DEs in wallpaper.el
  2022-09-23 12:02       ` Po Lu
@ 2022-09-23 13:06         ` Stefan Kangas
  2022-09-25 13:07           ` Stefan Kangas
  0 siblings, 1 reply; 8+ messages in thread
From: Stefan Kangas @ 2022-09-23 13:06 UTC (permalink / raw)
  To: Po Lu; +Cc: emacs-devel

Po Lu <luangruo@yahoo.com> writes:

> Only that they are encoded on my system running GNOME Shell:
>
>   file:///usr/local/share/backgrounds/Simple%20white.png

OK, how about something like this (100 % untested)?

diff --git a/lisp/image/wallpaper.el b/lisp/image/wallpaper.el
index aea13227a8..0f4fc8b133 100644
--- a/lisp/image/wallpaper.el
+++ b/lisp/image/wallpaper.el
@@ -56,7 +56,7 @@ wallpaper--default-commands
   ;; When updating this, also update the custom :type for `wallpaper-command'.
   '(
     ;; Gnome
-    ("gsettings" "set" "org.gnome.desktop.background" "picture-uri"
"file://%f")
+    ("gsettings" "set" "org.gnome.desktop.background" "picture-uri"
"file://%F")
     ;; KDE Plasma
     ("plasma-apply-wallpaperimage" "%f")
     ;; XFCE
@@ -69,9 +69,9 @@ wallpaper--default-commands
     ;; ;; Mate
     ;; ("gsettings" "set" "org.mate.background" "picture-filename" "%f")
     ;; ;; Cinnamon
-    ;; ("gsettings" "set" "org.cinnamon.desktop.background"
"picture-uri" "file://%f")
+    ;; ("gsettings" "set" "org.cinnamon.desktop.background"
"picture-uri" "file://%F")
     ;; ;; Deepin
-    ;; ("gsettings" "set" "com.deepin.wrap.gnome.desktop.background"
"picture-uri" "file://%f")
+    ;; ("gsettings" "set" "com.deepin.wrap.gnome.desktop.background"
"picture-uri" "file://%F")
     ;; Sway (Wayland)
     ("swaybg" "-o" "*" "-i" "%f" "-m" "fill")
     ;; Wayland General
@@ -310,6 +310,9 @@ wallpaper-set
          (unless wallpaper-command
            (error "Couldn't find a command to set the wallpaper with"))
          (let* ((fmt-spec `((?f . ,(expand-file-name file))
+                            (?F . ,(mapconcat #'url-hexify-string
+                                              (split-string file "/")
+                                              "/"))
                             (?h . ,(wallpaper--get-height-or-width
                                     "height"
                                     #'display-pixel-height



^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: master f25f4699d7 2/2: Support several new DEs in wallpaper.el
  2022-09-23 11:15     ` Stefan Kangas
  2022-09-23 12:02       ` Po Lu
@ 2022-09-23 13:20       ` Yuri Khan
  1 sibling, 0 replies; 8+ messages in thread
From: Yuri Khan @ 2022-09-23 13:20 UTC (permalink / raw)
  To: Stefan Kangas; +Cc: Po Lu, emacs-devel

On Fri, 23 Sept 2022 at 18:18, Stefan Kangas <stefankangas@gmail.com> wrote:

> Do you have reason to think that they would need to be encoded?  My
> findings so far would suggest that either they don't, or that a lot of
> people are getting this wrong.

Is URI syntax not reason enough? Unencoded spaces are not valid in
URIs, nor are non-ASCII characters, and various punctuation characters
that can appear in file names such as ‘?’ and ‘#’ are special in URIs.



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: master f25f4699d7 2/2: Support several new DEs in wallpaper.el
  2022-09-23 13:06         ` Stefan Kangas
@ 2022-09-25 13:07           ` Stefan Kangas
  0 siblings, 0 replies; 8+ messages in thread
From: Stefan Kangas @ 2022-09-25 13:07 UTC (permalink / raw)
  To: Po Lu; +Cc: emacs-devel

Stefan Kangas <stefankangas@gmail.com> writes:

> Po Lu <luangruo@yahoo.com> writes:
>
>> Only that they are encoded on my system running GNOME Shell:
>>
>>   file:///usr/local/share/backgrounds/Simple%20white.png
>
> OK, how about something like this (100 % untested)?

Now pushed to master as commit 3502fd9831.

> diff --git a/lisp/image/wallpaper.el b/lisp/image/wallpaper.el
> index aea13227a8..0f4fc8b133 100644
> --- a/lisp/image/wallpaper.el
> +++ b/lisp/image/wallpaper.el
> @@ -56,7 +56,7 @@ wallpaper--default-commands
>    ;; When updating this, also update the custom :type for `wallpaper-command'.
>    '(
>      ;; Gnome
> -    ("gsettings" "set" "org.gnome.desktop.background" "picture-uri" "file://%f")
> +    ("gsettings" "set" "org.gnome.desktop.background" "picture-uri" "file://%F")
>      ;; KDE Plasma
>      ("plasma-apply-wallpaperimage" "%f")
>      ;; XFCE
> @@ -69,9 +69,9 @@ wallpaper--default-commands
>      ;; ;; Mate
>      ;; ("gsettings" "set" "org.mate.background" "picture-filename" "%f")
>      ;; ;; Cinnamon
> -    ;; ("gsettings" "set" "org.cinnamon.desktop.background" "picture-uri" "file://%f")
> +    ;; ("gsettings" "set" "org.cinnamon.desktop.background" "picture-uri" "file://%F")
>      ;; ;; Deepin
> -    ;; ("gsettings" "set" "com.deepin.wrap.gnome.desktop.background" "picture-uri" "file://%f")
> +    ;; ("gsettings" "set" "com.deepin.wrap.gnome.desktop.background" "picture-uri" "file://%F")
>      ;; Sway (Wayland)
>      ("swaybg" "-o" "*" "-i" "%f" "-m" "fill")
>      ;; Wayland General
> @@ -310,6 +310,9 @@ wallpaper-set
>           (unless wallpaper-command
>             (error "Couldn't find a command to set the wallpaper with"))
>           (let* ((fmt-spec `((?f . ,(expand-file-name file))
> +                            (?F . ,(mapconcat #'url-hexify-string
> +                                              (split-string file "/")
> +                                              "/"))
>                              (?h . ,(wallpaper--get-height-or-width
>                                      "height"
>                                      #'display-pixel-height



^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2022-09-25 13:07 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <166389647969.2861.15735332086175539466@vcs2.savannah.gnu.org>
     [not found] ` <20220923012800.2B4E1C12D97@vcs2.savannah.gnu.org>
2022-09-23  4:52   ` master f25f4699d7 2/2: Support several new DEs in wallpaper.el Po Lu
2022-09-23  6:16     ` Eli Zaretskii
2022-09-23  6:22       ` Po Lu
2022-09-23 11:15     ` Stefan Kangas
2022-09-23 12:02       ` Po Lu
2022-09-23 13:06         ` Stefan Kangas
2022-09-25 13:07           ` Stefan Kangas
2022-09-23 13:20       ` Yuri Khan

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