Skip to content
This repository has been archived by the owner on Aug 5, 2024. It is now read-only.

Commit

Permalink
system/os: add hyprland portal to xdg-portal configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
NotAShelf committed Feb 18, 2024
1 parent 7cd14d5 commit 285e8fa
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 17 deletions.
2 changes: 1 addition & 1 deletion modules/core/common/system/os/display/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
_: {
{
imports = [
./wayland
./xorg
Expand Down
14 changes: 9 additions & 5 deletions modules/core/common/system/os/display/wayland/xdg-portals.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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}";
};
Expand Down
16 changes: 5 additions & 11 deletions modules/core/common/system/os/misc/xdg-portals.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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"
];
};
};
};
Expand Down

0 comments on commit 285e8fa

Please sign in to comment.