From 09da72a0bf42248b8cff62c6a73fb87f7d94424f Mon Sep 17 00:00:00 2001 From: NullBite Date: Tue, 23 Jan 2024 12:41:21 +0100 Subject: [PATCH] add KDE XDG desktop portal workaround --- system/plasma.nix | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/system/plasma.nix b/system/plasma.nix index 3b0374d..3afe65c 100644 --- a/system/plasma.nix +++ b/system/plasma.nix @@ -1,5 +1,8 @@ { config, lib, pkgs, ...}: - +let + sleep = "${pkgs.coreutils}/bin/sleep"; + systemctl = "${pkgs.systemd}/bin/systemctl"; +in { imports = [ ./desktop-common.nix @@ -10,6 +13,26 @@ services.xserver.displayManager.defaultSession = "plasmawayland"; programs.kdeconnect.enable = true; + # systemd.user.targets.plasma-core.unitConfig.Upholds = [ "restart-xdg-desktop-portal.service" ]; + systemd.user.targets.graphical-session.unitConfig.Wants = [ "restart-xdg-desktop-portal-kde.service" ]; + systemd.user = { + services.restart-xdg-desktop-portal-kde = { + enable = true; + description = "hack to fix xdg-desktop-portal on kde"; + # wantedBy = [ "plasma-core.target" ]; + after = [ "plasma-core.target" "xdg-desktop-portal.service" ]; + requisite = [ "plasma-core.target" ]; + serviceConfig = { + ExecStart = [ + "${sleep} 5" + "${systemctl} --user restart xdg-desktop-portal.service" + ]; + Type = "oneshot"; + RemainAfterExit = "yes"; + }; + }; + }; + environment.systemPackages = with pkgs; [ # this fixes tiny file dialogs for Minecraft libsForQt5.kdialog