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