wal+autorandr: update wallpaper on config change
This commit is contained in:
parent
a62ad9d59f
commit
ab45407c9b
|
@ -5,6 +5,9 @@ with lib;
|
||||||
let
|
let
|
||||||
cfg = config.programs.wal;
|
cfg = config.programs.wal;
|
||||||
walCmd = pkgs.pywal + /bin/wal;
|
walCmd = pkgs.pywal + /bin/wal;
|
||||||
|
updateCmd = ''
|
||||||
|
${walCmd} -i ${cfg.background} --backend ${cfg.backend} -e -s -t
|
||||||
|
'';
|
||||||
|
|
||||||
shellSequences = "~/.cache/wal/sequences";
|
shellSequences = "~/.cache/wal/sequences";
|
||||||
shellActivate = ''
|
shellActivate = ''
|
||||||
|
@ -43,9 +46,8 @@ in {
|
||||||
activation = {
|
activation = {
|
||||||
# Must be before onFilesChange because that's when other configs are reloaded
|
# Must be before onFilesChange because that's when other configs are reloaded
|
||||||
updateWalScheme =
|
updateWalScheme =
|
||||||
lib.hm.dag.entryBetween [ "onFilesChange" ] [ "writeBoundary" ] ''
|
lib.hm.dag.entryBetween [ "onFilesChange" ] [ "writeBoundary" ]
|
||||||
${walCmd} -i ${cfg.background} --backend ${cfg.backend} -e -s -t
|
updateCmd;
|
||||||
'';
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -55,5 +57,7 @@ in {
|
||||||
wayland.windowManager.sway = mkIf cfg.sway.enable {
|
wayland.windowManager.sway = mkIf cfg.sway.enable {
|
||||||
config.output."*".bg = "${cfg.background} ${cfg.sway.bgMode}";
|
config.output."*".bg = "${cfg.background} ${cfg.sway.bgMode}";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
programs.autorandr.hooks.postswitch = { "update-wallpaper" = updateCmd; };
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue