From 285e8fad0bffd85dfb114f7a15ae453fb7a2d646 Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Sun, 18 Feb 2024 19:32:10 +0300 Subject: [PATCH] system/os: add hyprland portal to xdg-portal configuration --- .../core/common/system/os/display/default.nix | 2 +- .../system/os/display/wayland/xdg-portals.nix | 14 +++++++++----- .../core/common/system/os/misc/xdg-portals.nix | 16 +++++----------- 3 files changed, 15 insertions(+), 17 deletions(-) diff --git a/modules/core/common/system/os/display/default.nix b/modules/core/common/system/os/display/default.nix index 90eb91c08..a383d423d 100644 --- a/modules/core/common/system/os/display/default.nix +++ b/modules/core/common/system/os/display/default.nix @@ -1,4 +1,4 @@ -_: { +{ imports = [ ./wayland ./xorg diff --git a/modules/core/common/system/os/display/wayland/xdg-portals.nix b/modules/core/common/system/os/display/wayland/xdg-portals.nix index e821b1f36..fd286a3ef 100644 --- a/modules/core/common/system/os/display/wayland/xdg-portals.nix +++ b/modules/core/common/system/os/display/wayland/xdg-portals.nix @@ -12,20 +12,24 @@ in { xdg.portal = { enable = true; - extraPortals = [ - pkgs.xdg-desktop-portal-gtk - ]; + extraPortals = [pkgs.xdg-desktop-portal-gtk]; config = { common = let portal = if env.desktop == "Hyprland" then "hyprland" - else "wlr"; + else if env.desktop == "sway" + then "wlr" + else "gtk"; # FIXME: does this actually implement what we need? in { + default = [ + "hyprland" + "gtk" + ]; + # for flameshot to work # https://github.com/flameshot-org/flameshot/issues/3363#issuecomment-1753771427 - default = "gtk"; "org.freedesktop.impl.portal.Screencast" = "${portal}"; "org.freedesktop.impl.portal.Screenshot" = "${portal}"; }; diff --git a/modules/core/common/system/os/misc/xdg-portals.nix b/modules/core/common/system/os/misc/xdg-portals.nix index 02a03c6d0..bc8041295 100644 --- a/modules/core/common/system/os/misc/xdg-portals.nix +++ b/modules/core/common/system/os/misc/xdg-portals.nix @@ -7,17 +7,11 @@ inherit (lib) mkIf; in { config = mkIf sys.video.enable { - xdg.portal = { - config = { - common = { - default = [ - "gtk" - ]; - - "org.freedesktop.impl.portal.Secret" = [ - "gnome-keyring" - ]; - }; + xdg.portal.config = { + common = { + "org.freedesktop.impl.portal.Secret" = [ + "gnome-keyring" + ]; }; }; };