From d97229fa112b6f2900176fe7f999a14f92f1334f Mon Sep 17 00:00:00 2001 From: Andrea Ciceri Date: Wed, 25 Sep 2024 14:18:52 +0200 Subject: [PATCH] Fix `waybar` startup latency problem --- hmModules/tremotesf/default.nix | 4 +++- hmModules/zmkbatx/default.nix | 3 +-- modules/xdg/default.nix | 15 +++++++++------ 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/hmModules/tremotesf/default.nix b/hmModules/tremotesf/default.nix index a3569a1..82c1336 100644 --- a/hmModules/tremotesf/default.nix +++ b/hmModules/tremotesf/default.nix @@ -7,7 +7,9 @@ home.packages = [ pkgs.tremotesf ]; systemd.user.services.tremotesf = { - Install.WantedBy = [ "graphical-session.target" ]; + Install.WantedBy = [ + "waybar.service" + ]; Unit = { Description = "tremotesf"; diff --git a/hmModules/zmkbatx/default.nix b/hmModules/zmkbatx/default.nix index b7f9065..0070092 100644 --- a/hmModules/zmkbatx/default.nix +++ b/hmModules/zmkbatx/default.nix @@ -8,7 +8,6 @@ systemd.user.services.zmkBATx = { Install.WantedBy = [ - "graphical-session.target" "waybar.service" ]; @@ -17,7 +16,7 @@ }; Service = { - ExecStart = lib.getExe pkgs.zmkBATx; + ExecStart = "sleep 5 && ${lib.getExe pkgs.zmkBATx}"; Restart = "on-failure"; RestartSec = 3; }; diff --git a/modules/xdg/default.nix b/modules/xdg/default.nix index 0a07d40..c1aa55a 100644 --- a/modules/xdg/default.nix +++ b/modules/xdg/default.nix @@ -3,15 +3,18 @@ xdg = { portal = { enable = true; - extraPortals = with pkgs; [ + configPackages = with pkgs; [ + xdg-desktop-portal-wlr xdg-desktop-portal-gtk xdg-desktop-portal-hyprland ]; - config.common.default = "*"; + extraPortals = with pkgs; [ + xdg-desktop-portal-wlr + xdg-desktop-portal-gtk + xdg-desktop-portal-hyprland + ]; + xdgOpenUsePortal = true; + wlr.enable = true; }; }; - - environment.sessionVariables = { - GTK_USE_PORTAL = "1"; - }; }