mirror of
https://github.com/nix-community/home-manager
synced 2024-11-22 20:53:14 +00:00
Make sway onChange script use cfg.package if set (#2937)
This commit is contained in:
parent
4036f1a751
commit
538343be86
1 changed files with 4 additions and 2 deletions
|
@ -431,12 +431,14 @@ in {
|
|||
home.packages = optional (cfg.package != null) cfg.package
|
||||
++ optional cfg.xwayland pkgs.xwayland;
|
||||
|
||||
xdg.configFile."sway/config" = {
|
||||
xdg.configFile."sway/config" = let
|
||||
swayPackage = if cfg.package == null then pkgs.sway else cfg.package;
|
||||
in {
|
||||
source = configFile;
|
||||
onChange = ''
|
||||
swaySocket="''${XDG_RUNTIME_DIR:-/run/user/$UID}/sway-ipc.$UID.$(${pkgs.procps}/bin/pgrep --uid $UID -x sway || true).sock"
|
||||
if [ -S "$swaySocket" ]; then
|
||||
${pkgs.sway}/bin/swaymsg -s $swaySocket reload
|
||||
${swayPackage}/bin/swaymsg -s $swaySocket reload
|
||||
fi
|
||||
'';
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue