Skip to content

Commit

Permalink
graphical/addons/xdg-portal: tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
khaneliman committed Jul 15, 2024
1 parent df9175a commit dc10d7f
Showing 1 changed file with 26 additions and 20 deletions.
46 changes: 26 additions & 20 deletions modules/nixos/programs/graphical/addons/xdg-portal/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -23,29 +23,35 @@ in
xdg = {
portal = {
enable = true;

config = {
common =
let
portal =
if config.${namespace}.programs.graphical.wms.hyprland.enable == "Hyprland" then
"hyprland"
else if config.${namespace}.programs.graphical.wms.sway.enable == "sway" then
"wlr"
else
"gtk";
in
{
default = [
"hyprland"
"gtk"
];
hyprland = mkIf config.${namespace}.programs.graphical.wms.hyprland.enable {
default = [
"hyprland"
"gtk"
];
"org.freedesktop.impl.portal.Screencast" = "hyprland";
"org.freedesktop.impl.portal.Screenshot" = "hyprland";
};

sway = mkIf config.${namespace}.programs.graphical.wms.sway.enable {
default = [
"wlr"
"gtk"
];
"org.freedesktop.impl.portal.Screencast" = "wlr";
"org.freedesktop.impl.portal.Screenshot" = "wlr";
};

# for flameshot to work
# https://github.com/flameshot-org/flameshot/issues/3363#issuecomment-1753771427
"org.freedesktop.impl.portal.Screencast" = "${portal}";
"org.freedesktop.impl.portal.Screenshot" = "${portal}";
};
common = {
default = [ "gtk" ];

"org.freedesktop.impl.portal.Screencast" = "gtk";
"org.freedesktop.impl.portal.Screenshot" = "gtk";
"org.freedesktop.impl.portal.Secret" = [ "gnome-keyring" ];
};
};

extraPortals =
with pkgs;
[ xdg-desktop-portal-gtk ]
Expand Down

0 comments on commit dc10d7f

Please sign in to comment.