mirror of
https://github.com/moons-14/dotfiles.git
synced 2026-10-06 09:48:11 +09:00
fix error
This commit is contained in:
@@ -6,61 +6,66 @@ let
|
||||
rev = "40912e6418737e93b59a38bcf189270cbf26656d";
|
||||
hash = "sha256-1QR3J+wgLVNjucPSVELv0FicNt+jM2KPLU5ubBfxjHI=";
|
||||
};
|
||||
|
||||
swwwScript = ./swww.sh;
|
||||
in {
|
||||
home.file."wallpapers" = {
|
||||
source = walls;
|
||||
recursive = true;
|
||||
};
|
||||
|
||||
home.file.".local/bin/set-wallpaper.sh" = {
|
||||
source = ./set-wallpaper.sh;
|
||||
home.packages = with pkgs; [
|
||||
swww
|
||||
];
|
||||
|
||||
home.file.".config/swww/swww.sh" = {
|
||||
source = swwwScript;
|
||||
executable = true;
|
||||
};
|
||||
|
||||
home.packages = with pkgs; [
|
||||
swww
|
||||
bash
|
||||
findutils
|
||||
coreutils
|
||||
];
|
||||
|
||||
systemd.user.services.swww = {
|
||||
systemd.user.services."swww-daemon" = {
|
||||
Unit = {
|
||||
Description = "swww init (Wayland wallpaper daemon)";
|
||||
Description = "SWWW daemon";
|
||||
After = [ "graphical-session.target" ];
|
||||
PartOf = [ "graphical-session.target" ];
|
||||
};
|
||||
Service = {
|
||||
ExecStart = [ "${pkgs.swww}/bin/swww" "init" ];
|
||||
Type = "simple";
|
||||
Environment = [
|
||||
"PATH=${lib.makeBinPath [ pkgs.swww pkgs.coreutils pkgs.findutils pkgs.bash ]}:$PATH"
|
||||
];
|
||||
ExecStart = "${pkgs.bash}/bin/bash -lc 'if swww query >/dev/null 2>&1; then exit 0; else exec swww-daemon -f xrgb; fi'";
|
||||
Restart = "on-failure";
|
||||
RestartSec = 2;
|
||||
};
|
||||
Install = {
|
||||
WantedBy = [ "graphical-session.target" ];
|
||||
};
|
||||
};
|
||||
|
||||
systemd.user.services."wallpaper-rotate" = {
|
||||
systemd.user.services."change-wallpaper" = {
|
||||
Unit = {
|
||||
Description = "Rotate wallpaper via swww";
|
||||
After = [ "swww.service" "graphical-session.target" ];
|
||||
Wants = [ "swww.service" ];
|
||||
Description = "Set/rotate wallpaper via swww";
|
||||
After = [ "swww-daemon.service" "graphical-session.target" ];
|
||||
};
|
||||
Service = {
|
||||
Type = "oneshot";
|
||||
ExecStart = [ "${pkgs.bash}/bin/bash" "/home/moons/.local/bin/set-wallpaper.sh" ];
|
||||
Environment = [
|
||||
"PATH=${lib.makeBinPath [ pkgs.swww pkgs.coreutils pkgs.findutils pkgs.bash ]}:$PATH"
|
||||
];
|
||||
ExecStart = "${pkgs.bash}/bin/bash -lc '$HOME/.config/swww/swww.sh'";
|
||||
};
|
||||
Install = {
|
||||
WantedBy = [ "default.target" ];
|
||||
WantedBy = [ "graphical-session.target" ];
|
||||
};
|
||||
};
|
||||
|
||||
systemd.user.timers."wallpaper-rotate" = {
|
||||
systemd.user.timers."change-wallpaper" = {
|
||||
Unit = {
|
||||
Description = "Change wallpaper every 1 minute";
|
||||
Description = "Timer to change wallpapers every hour";
|
||||
};
|
||||
Timer = {
|
||||
OnBootSec = "30s";
|
||||
OnUnitActiveSec = "1min";
|
||||
Unit = "wallpaper-rotate.service";
|
||||
OnCalendar = "hourly";
|
||||
Persistent = true;
|
||||
};
|
||||
Install = {
|
||||
|
||||
Reference in New Issue
Block a user