Bug#1050917: phosh: please provide a phosh-portals.conf for xdg-desktop-portal

2023-08-31 Thread Guido Günther
Hi,
On Thu, Aug 31, 2023 at 02:13:54PM +0100, Simon McVittie wrote:
> Control: tags -1 + fixed-upstream
> Control: forwarded -1 
> https://gitlab.gnome.org/World/Phosh/phosh/-/merge_requests/1301
> 
> On Thu, 31 Aug 2023 at 14:22:17 +0200, Guido Günther wrote:
> > I wasn't aware that `none` works, thanks for that!
> 
> I must admit that I've never actually tried that feature, so you might
> have to report bugs if it falls back to considering UseIn (I expect this
> to be a relatively rare use-case).
> 
> > Do you know of a way to have the config outside of `/etc/` so that
> > admins don't have to modify the conf file but can override it if they
> > want to make changes?
> 
> Since 1.17.1 it can/should be
> /usr/share/xdg-desktop-portal/phosh-portals.conf (and that's what I've been
> recommending in this MBF).
> 
> In the initial implementation of this feature in x-d-p
> 1.17.0, only /etc was searched, but I thought that was
> wrong, and fixed it to behave more like mimeapps.list in
>  which was
> included in 1.17.1.
> 
> I opened  upstream
> with a suggested (but untested) change.

That helps, I'll take it from there. Thanks a lot!
 -- Guido



Bug#1050917: phosh: please provide a phosh-portals.conf for xdg-desktop-portal

2023-08-31 Thread Simon McVittie
Control: tags -1 + fixed-upstream
Control: forwarded -1 
https://gitlab.gnome.org/World/Phosh/phosh/-/merge_requests/1301

On Thu, 31 Aug 2023 at 14:22:17 +0200, Guido Günther wrote:
> I wasn't aware that `none` works, thanks for that!

I must admit that I've never actually tried that feature, so you might
have to report bugs if it falls back to considering UseIn (I expect this
to be a relatively rare use-case).

> Do you know of a way to have the config outside of `/etc/` so that
> admins don't have to modify the conf file but can override it if they
> want to make changes?

Since 1.17.1 it can/should be
/usr/share/xdg-desktop-portal/phosh-portals.conf (and that's what I've been
recommending in this MBF).

In the initial implementation of this feature in x-d-p
1.17.0, only /etc was searched, but I thought that was
wrong, and fixed it to behave more like mimeapps.list in
 which was
included in 1.17.1.

I opened  upstream
with a suggested (but untested) change.

smcv



Bug#1050917: [Debian-on-mobile-maintainers] Bug#1050917: phosh: please provide a phosh-portals.conf for xdg-desktop-portal

2023-08-31 Thread Guido Günther
Hi Simon,
On Thu, Aug 31, 2023 at 12:41:02PM +0100, Simon McVittie wrote:
> Package: phosh
> Severity: normal
> Tags: trixie sid
> User: xdg-desktop-por...@packages.debian.org
> Usertags: portals.conf
> 
> xdg-desktop-portal 1.17.x introduces a new way to select which portals will
> be used for which desktop environments, modelled on mimeapps.list:
> 
> - each desktop environment should provide a file like
>   /usr/share/xdg-desktop-portal/phosh-portals.conf
> 
> - the filename is ${DESKTOP}-portals.conf where ${DESKTOP} is the desktop
>   environment's entry in $XDG_CURRENT_DESKTOP (the same as the DesktopNames
>   from /usr/share/{x,wayland-}sessions/*.desktop), folded to lower case
> 
> - sysadmins and users can override this via files named portals.conf or
>   ${DESKTOP}-portals.conf in various locations like /etc/xdg-desktop-portal
>   and ~/.config/xdg-desktop-portal
> 
> Please see portals.conf(5) or its source code
> https://github.com/flatpak/xdg-desktop-portal/blob/main/doc/portals-conf.rst
> for full details.
> 
> If I'm reading correctly, I think phosh uses
> XDG_CURRENT_DESKTOP="Phosh:GNOME" but needs portals that are not quite the
> same as GNOME's, because it's using a wlroots-based compositor instead of
> the mutter-based GNOME Shell?
> 
> If that's the case, then it should provide a phosh-portals.conf so that
> individual users aren't required to set this up for themselves.
> 
> For example, it might look something like this (this is untested and based
> on guesses, I don't use Phosh myself, so please check this carefully):

Thanks for the details! We already have that fixed upstream¹ and it'll
trickle into Debian in the next week or so with the 0.31.0 release. We
can't use the GNOME portals atm as they require mutter's
org.gnome.Mutter.ServiceChannel which I'll need to add support for in
phoc first.

I wasn't aware that `none` works, thanks for that!

Do you know of a way to have the config outside of `/etc/` so that
admins don't have to modify the conf file but can override it if they
want to make changes?

Cheers,
 -- Guido

1) https://gitlab.gnome.org/World/Phosh/phosh/-/merge_requests/1301



Bug#1050917: phosh: please provide a phosh-portals.conf for xdg-desktop-portal

2023-08-31 Thread Simon McVittie
Package: phosh
Severity: normal
Tags: trixie sid
User: xdg-desktop-por...@packages.debian.org
Usertags: portals.conf

xdg-desktop-portal 1.17.x introduces a new way to select which portals will
be used for which desktop environments, modelled on mimeapps.list:

- each desktop environment should provide a file like
  /usr/share/xdg-desktop-portal/phosh-portals.conf

- the filename is ${DESKTOP}-portals.conf where ${DESKTOP} is the desktop
  environment's entry in $XDG_CURRENT_DESKTOP (the same as the DesktopNames
  from /usr/share/{x,wayland-}sessions/*.desktop), folded to lower case

- sysadmins and users can override this via files named portals.conf or
  ${DESKTOP}-portals.conf in various locations like /etc/xdg-desktop-portal
  and ~/.config/xdg-desktop-portal

Please see portals.conf(5) or its source code
https://github.com/flatpak/xdg-desktop-portal/blob/main/doc/portals-conf.rst
for full details.

If I'm reading correctly, I think phosh uses
XDG_CURRENT_DESKTOP="Phosh:GNOME" but needs portals that are not quite the
same as GNOME's, because it's using a wlroots-based compositor instead of
the mutter-based GNOME Shell?

If that's the case, then it should provide a phosh-portals.conf so that
individual users aren't required to set this up for themselves.

For example, it might look something like this (this is untested and based
on guesses, I don't use Phosh myself, so please check this carefully):

[preferred]
default=gtk;
org.freedesktop.impl.portal.Secret=gnome-keyring;
# Non-GNOME-Shell-specific parts of x-d-p-gnome
org.freedesktop.impl.portal.Account=gnome;gtk;
org.freedesktop.impl.portal.AppChooser=gnome;gtk;
org.freedesktop.impl.portal.Background=gnome;gtk;
org.freedesktop.impl.portal.DynamicLauncher=gnome;gtk;
org.freedesktop.impl.portal.FileChooser=gnome;gtk;
org.freedesktop.impl.portal.Lockdown=gnome;gtk;
org.freedesktop.impl.portal.Print=gnome;gtk;
org.freedesktop.impl.portal.Settings=gnome;gtk;
org.freedesktop.impl.portal.Wallpaper=gnome;gtk;
# Phosh-specific
org.freedesktop.impl.portal.Access=phosh;
org.freedesktop.impl.portal.RemoteDesktop=none;
org.freedesktop.impl.portal.ScreenCast=wlr;
org.freedesktop.impl.portal.Screenshot=wlr;

The desktop environment (either phosh or some larger metapackage) should
probably also have a Recommends, or at least a Suggests, on whatever
portals would be most appropriate for it.

Thanks,
smcv

-- 
This is part of a mass bug filing:
https://lists.debian.org/debian-devel/2023/08/msg00311.html