Mailing List Archive

[PATCH GnuPG 2/2] Prefer opening images with xdg-open over display
xdg-open respects the user's configured image viewer
and is therefore preferred.

display is still available as a fallback when xdg-open
isn't available.

Signed-off-by: Nicolas Fella <nicolas.fella@gmx.de>
---
g10/photoid.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/g10/photoid.c b/g10/photoid.c
index e6f0a41a6..1ba8190b9 100644
--- a/g10/photoid.c
+++ b/g10/photoid.c
@@ -284,11 +284,11 @@ get_default_photo_command(void)
#else
if (!path_access ("xloadimage", X_OK))
return "xloadimage -fork -quiet -title 'KeyID 0x%k' stdin";
- else if (!path_access ("display",X_OK))
- return "display -title 'KeyID 0x%k' %i";
else if (getuid () && !path_access ("xdg-open", X_OK))
/* xdg-open spawns the actual program and exits so we need to keep the temp file */
return "xdg-open %I";
+ else if (!path_access ("display",X_OK))
+ return "display -title 'KeyID 0x%k' %i";
else
return "/bin/true";
#endif
--
2.30.1


_______________________________________________
Gnupg-devel mailing list
Gnupg-devel@gnupg.org
http://lists.gnupg.org/mailman/listinfo/gnupg-devel
Re: [PATCH GnuPG 2/2] Prefer opening images with xdg-open over display [ In reply to ]
Hi Nicolas,

any reason why xloadimage should still be preferred over xdg-open?

Regards,
Ingo

On Sonntag, 28. Februar 2021 14:34:11 CET Nicolas Fella via Gnupg-devel wrote:
> xdg-open respects the user's configured image viewer
> and is therefore preferred.
>
> display is still available as a fallback when xdg-open
> isn't available.
>
> Signed-off-by: Nicolas Fella <nicolas.fella@gmx.de>
> ---
> g10/photoid.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/g10/photoid.c b/g10/photoid.c
> index e6f0a41a6..1ba8190b9 100644
> --- a/g10/photoid.c
> +++ b/g10/photoid.c
> @@ -284,11 +284,11 @@ get_default_photo_command(void)
> #else
> if (!path_access ("xloadimage", X_OK))
> return "xloadimage -fork -quiet -title 'KeyID 0x%k' stdin";
> - else if (!path_access ("display",X_OK))
> - return "display -title 'KeyID 0x%k' %i";
> else if (getuid () && !path_access ("xdg-open", X_OK))
> /* xdg-open spawns the actual program and exits so we need to keep the
> temp file */ return "xdg-open %I";
> + else if (!path_access ("display",X_OK))
> + return "display -title 'KeyID 0x%k' %i";
> else
> return "/bin/true";
> #endif
> --
> 2.30.1
>
>
> _______________________________________________
> Gnupg-devel mailing list
> Gnupg-devel@gnupg.org
> http://lists.gnupg.org/mailman/listinfo/gnupg-devel
Re: [PATCH GnuPG 2/2] Prefer opening images with xdg-open over display [ In reply to ]
On Sun, 28 Feb 2021 17:40, Ingo Klöcker said:

> any reason why xloadimage should still be preferred over xdg-open?

Never change running code. xloadimage is a simpler than display and
thus we should keep support for it.


Salam-Shalom,

Werner

--
Die Gedanken sind frei. Ausnahmen regelt ein Bundesgesetz.
Re: [PATCH GnuPG 2/2] Prefer opening images with xdg-open over display [ In reply to ]
On Sun, 28 Feb 2021 14:34, Nicolas Fella said:
> xdg-open respects the user's configured image viewer
> and is therefore preferred.

This would be a regression. display and xloadimage both allow to pass
the title. This seems not to be possible with xdg-open.


Shalom-Salam,

Werner

--
Die Gedanken sind frei. Ausnahmen regelt ein Bundesgesetz.
Re: [PATCH GnuPG 2/2] Prefer opening images with xdg-open over display [ In reply to ]
Hi Ingo,

no reason, IMHO xdg-open should be preferred over xloadimage too, but
Werner seems to disagree on that, for valid reasons.

Cheers

Nico

On 2/28/21 5:40 PM, Ingo Kl?cker wrote:
> Hi Nicolas,
>
> any reason why xloadimage should still be preferred over xdg-open?
>
> Regards,
> Ingo
>
> On Sonntag, 28. Februar 2021 14:34:11 CET Nicolas Fella via Gnupg-devel wrote:
>> xdg-open respects the user's configured image viewer
>> and is therefore preferred.
>>
>> display is still available as a fallback when xdg-open
>> isn't available.
>>
>> Signed-off-by: Nicolas Fella <nicolas.fella@gmx.de>
>> ---
>> g10/photoid.c | 4 ++--
>> 1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/g10/photoid.c b/g10/photoid.c
>> index e6f0a41a6..1ba8190b9 100644
>> --- a/g10/photoid.c
>> +++ b/g10/photoid.c
>> @@ -284,11 +284,11 @@ get_default_photo_command(void)
>> #else
>> if (!path_access ("xloadimage", X_OK))
>> return "xloadimage -fork -quiet -title 'KeyID 0x%k' stdin";
>> - else if (!path_access ("display",X_OK))
>> - return "display -title 'KeyID 0x%k' %i";
>> else if (getuid () && !path_access ("xdg-open", X_OK))
>> /* xdg-open spawns the actual program and exits so we need to keep the
>> temp file */ return "xdg-open %I";
>> + else if (!path_access ("display",X_OK))
>> + return "display -title 'KeyID 0x%k' %i";
>> else
>> return "/bin/true";
>> #endif
>> --
>> 2.30.1
>>
>>
>> _______________________________________________
>> Gnupg-devel mailing list
>> Gnupg-devel@gnupg.org
>> http://lists.gnupg.org/mailman/listinfo/gnupg-devel

_______________________________________________
Gnupg-devel mailing list
Gnupg-devel@gnupg.org
http://lists.gnupg.org/mailman/listinfo/gnupg-devel