gui: fold xdg-desktop-portal.nix back into sway config

This commit is contained in:
Colin 2024-02-12 01:38:05 +00:00
parent 66ca822ac1
commit 8d0d20757e
3 changed files with 19 additions and 34 deletions

View File

@ -11,7 +11,6 @@ in
./greetd.nix
./gtk.nix
./phosh.nix
./xdg-desktop-portal.nix
./sway
./sxmo
./theme

View File

@ -180,7 +180,22 @@ in
"wl-clipboard"
"wob" # render volume changes on-screen
"xdg-desktop-portal"
# xdg-desktop-portal-gtk provides portals for:
# - org.freedesktop.impl.portal.Access
# - org.freedesktop.impl.portal.Account
# - org.freedesktop.impl.portal.DynamicLauncher
# - org.freedesktop.impl.portal.Email
# - org.freedesktop.impl.portal.FileChooser
# - org.freedesktop.impl.portal.Inhibit
# - org.freedesktop.impl.portal.Notification
# - org.freedesktop.impl.portal.Print
# and conditionally (i.e. unless buildPortalsInGnome = false) for:
# - org.freedesktop.impl.portal.AppChooser (@appchooser_iface@)
# - org.freedesktop.impl.portal.Lockdown (@lockdown_iface@)
# - org.freedesktop.impl.portal.Settings (@settings_iface@)
# - org.freedesktop.impl.portal.Wallpaper (@wallpaper_iface@)
"xdg-desktop-portal-gtk"
# xdg-desktop-portal-wlr provides portals for screenshots/screen sharing
"xdg-desktop-portal-wlr"
"xdg-terminal-exec" # used by sway config
];
@ -313,32 +328,10 @@ in
};
programs.xwayland.enable = cfg.config.xwayland;
# provide portals for:
# - org.freedesktop.impl.portal.Access
# - org.freedesktop.impl.portal.Account
# - org.freedesktop.impl.portal.DynamicLauncher
# - org.freedesktop.impl.portal.Email
# - org.freedesktop.impl.portal.FileChooser
# - org.freedesktop.impl.portal.Inhibit
# - org.freedesktop.impl.portal.Notification
# - org.freedesktop.impl.portal.Print
# and conditionally (i.e. unless buildPortalsInGnome = false) for:
# - org.freedesktop.impl.portal.AppChooser (@appchooser_iface@)
# - org.freedesktop.impl.portal.Lockdown (@lockdown_iface@)
# - org.freedesktop.impl.portal.Settings (@settings_iface@)
# - org.freedesktop.impl.portal.Wallpaper (@wallpaper_iface@)
# xdg.portal.extraPortals = [
# pkgs.xdg-desktop-portal-gtk
# # N.B.: xdg-desktop-portal will only provide `org.freedesktop.portal.OpenURI`
# # if it sees a `org.freedesktop.impl.portal.AppChooser` implementation on the bus.
# # so to be able to do file opening over dbus instead of base `xdg-open`, `buildPortalsInGnome` MUST be true.
# # previously `buildPortalsInGnome` provided `ScreenCast` and `Screenshot`, which conflicted with sway.
# # nowadays, those live in `xdg-desktop-portal-gnome` proper.
# # (pkgs.xdg-desktop-portal-gtk.override {
# # buildPortalsInGnome = false;
# # })
# ];
# disable nixos' portal module, otherwise /share/applications gets linked into the system and complicates things (sandboxing).
# instead, i manage portals myself via the sane.programs API (e.g. sane.programs.xdg-desktop-portal).
xdg.portal.enable = false;
xdg.menus.enable = false; #< links /share/applications, and a bunch of other empty (i.e. unused) dirs
environment.etc."xdg/xdg-desktop-portal/sway-portals.conf".text = ''
[preferred]
default=wlr;gtk

View File

@ -1,7 +0,0 @@
# TODO: fold into sway
{ ... }:
{
# otherwise /share/applications gets linked into the system and complicates things (sandboxing)
xdg.portal.enable = false;
xdg.menus.enable = false; #< links /share/applications, and a bunch of other empty (i.e. unused) dirs
}