From adb54657d4e37ce88fe9523afca21c62148651db Mon Sep 17 00:00:00 2001 From: Colin Date: Thu, 30 May 2024 09:46:04 +0000 Subject: [PATCH] sway: fix bonsai to be visible in the sandbox --- hosts/common/programs/bonsai.nix | 4 ++++ hosts/common/programs/sway/default.nix | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/hosts/common/programs/bonsai.nix b/hosts/common/programs/bonsai.nix index e05004b8..12710324 100644 --- a/hosts/common/programs/bonsai.nix +++ b/hosts/common/programs/bonsai.nix @@ -112,10 +112,14 @@ in services.bonsaid = { description = "bonsai: programmable input dispatcher"; + dependencyOf = [ "sway" ]; # to ensure `$XDG_RUNTIME_DIR/bonsai` exists before sway binds it partOf = [ "graphical-session" ]; # nice -n -11 chosen arbitrarily. i hope this will allow for faster response to inputs, but without audio underruns (pipewire is -21, dino -15-ish) command = "nice -n -11 bonsaid -t $HOME/.config/bonsai/bonsai_tree.json"; cleanupCommand = "rm -f $XDG_RUNTIME_DIR/bonsai"; + readiness.waitExists = [ + "$XDG_RUNTIME_DIR/bonsai" + ]; }; }; } diff --git a/hosts/common/programs/sway/default.nix b/hosts/common/programs/sway/default.nix index dd25cd55..29ff5930 100644 --- a/hosts/common/programs/sway/default.nix +++ b/hosts/common/programs/sway/default.nix @@ -190,7 +190,10 @@ in sandbox.whitelistDri = true; sandbox.whitelistX = true; # sway invokes xwayland itself sandbox.whitelistWayland = true; - sandbox.extraRuntimePaths = [ "sway" ]; + sandbox.extraRuntimePaths = [ + "bonsai" + "sway" + ]; sandbox.extraPaths = [ # "/dev/input" "/run/seatd.sock" #< required if not using `logind` systemd login manager