Regenerated
This commit is contained in:
+325
-303
File diff suppressed because it is too large
Load Diff
+37
-15
@@ -2387,24 +2387,46 @@ in
|
||||
after = [ "graphical-session.target" ];
|
||||
|
||||
serviceConfig.Type = "oneshot";
|
||||
serviceConfig.ExecStart = ''
|
||||
/bin/sh -c '
|
||||
# Ensure destination exists
|
||||
mkdir -p ${wallpaperDst}
|
||||
{ config, pkgs, lib, flakeRoot, ... }:
|
||||
|
||||
# Copy all wallpapers
|
||||
rsync -au --ignore-existing ${wallpaperSrc}/ ${wallpaperDst}/
|
||||
rsync -au ${wallpaperSrc}/ ${wallpaperDst}/
|
||||
let
|
||||
username = config.defaultUser or "henrov";
|
||||
homeDir = "/home/${username}";
|
||||
wallpaperSrc = "${flakeRoot}/assets/traveldroid/Wallpapers";
|
||||
wallpaperDst = "${homeDir}/Wallpapers";
|
||||
scriptFile = "${wallpaperDst}/set-wallpapers-at-logon.sh";
|
||||
in
|
||||
{
|
||||
environment.systemPackages = with pkgs; [
|
||||
swww
|
||||
waypaper
|
||||
jq
|
||||
rsync
|
||||
];
|
||||
|
||||
# Start swww daemon if not running
|
||||
pgrep swww >/dev/null 2>&1 || swww &
|
||||
systemd.user.services.wallpaperSync = {
|
||||
description = "Sync Wallpapers and run set-wallpapers-at-logon.sh";
|
||||
wants = [ "graphical-session.target" ];
|
||||
after = [ "graphical-session.target" ];
|
||||
|
||||
# Run the logon wallpaper script if it exists
|
||||
[ -x "${scriptFile}" ] && "${scriptFile}"
|
||||
'
|
||||
'';
|
||||
serviceConfig.Restart = "on-failure";
|
||||
};
|
||||
serviceConfig.Type = "oneshot";
|
||||
|
||||
# Use a proper shell script invocation
|
||||
serviceConfig.ExecStart = ''
|
||||
${pkgs.bash}/bin/bash -c '
|
||||
mkdir -p "${wallpaperDst}"
|
||||
rsync -avu --ignore-existing "${wallpaperSrc}/" "${wallpaperDst}/"
|
||||
rsync -avu "${wallpaperSrc}/" "${wallpaperDst}/"
|
||||
|
||||
# Start swww if not running
|
||||
pgrep swww >/dev/null 2>&1 || swww &
|
||||
|
||||
# Run the logon wallpaper script if executable
|
||||
if [ -x "${scriptFile}" ]; then
|
||||
"${scriptFile}"
|
||||
fi
|
||||
'
|
||||
'';
|
||||
|
||||
############################
|
||||
# Timer to run the service every 15 minutes
|
||||
|
||||
@@ -27,24 +27,46 @@ in
|
||||
after = [ "graphical-session.target" ];
|
||||
|
||||
serviceConfig.Type = "oneshot";
|
||||
serviceConfig.ExecStart = ''
|
||||
/bin/sh -c '
|
||||
# Ensure destination exists
|
||||
mkdir -p ${wallpaperDst}
|
||||
{ config, pkgs, lib, flakeRoot, ... }:
|
||||
|
||||
# Copy all wallpapers
|
||||
rsync -au --ignore-existing ${wallpaperSrc}/ ${wallpaperDst}/
|
||||
rsync -au ${wallpaperSrc}/ ${wallpaperDst}/
|
||||
let
|
||||
username = config.defaultUser or "henrov";
|
||||
homeDir = "/home/${username}";
|
||||
wallpaperSrc = "${flakeRoot}/assets/traveldroid/Wallpapers";
|
||||
wallpaperDst = "${homeDir}/Wallpapers";
|
||||
scriptFile = "${wallpaperDst}/set-wallpapers-at-logon.sh";
|
||||
in
|
||||
{
|
||||
environment.systemPackages = with pkgs; [
|
||||
swww
|
||||
waypaper
|
||||
jq
|
||||
rsync
|
||||
];
|
||||
|
||||
# Start swww daemon if not running
|
||||
pgrep swww >/dev/null 2>&1 || swww &
|
||||
systemd.user.services.wallpaperSync = {
|
||||
description = "Sync Wallpapers and run set-wallpapers-at-logon.sh";
|
||||
wants = [ "graphical-session.target" ];
|
||||
after = [ "graphical-session.target" ];
|
||||
|
||||
# Run the logon wallpaper script if it exists
|
||||
[ -x "${scriptFile}" ] && "${scriptFile}"
|
||||
'
|
||||
'';
|
||||
serviceConfig.Restart = "on-failure";
|
||||
};
|
||||
serviceConfig.Type = "oneshot";
|
||||
|
||||
# Use a proper shell script invocation
|
||||
serviceConfig.ExecStart = ''
|
||||
${pkgs.bash}/bin/bash -c '
|
||||
mkdir -p "${wallpaperDst}"
|
||||
rsync -avu --ignore-existing "${wallpaperSrc}/" "${wallpaperDst}/"
|
||||
rsync -avu "${wallpaperSrc}/" "${wallpaperDst}/"
|
||||
|
||||
# Start swww if not running
|
||||
pgrep swww >/dev/null 2>&1 || swww &
|
||||
|
||||
# Run the logon wallpaper script if executable
|
||||
if [ -x "${scriptFile}" ]; then
|
||||
"${scriptFile}"
|
||||
fi
|
||||
'
|
||||
'';
|
||||
|
||||
############################
|
||||
# Timer to run the service every 15 minutes
|
||||
|
||||
Reference in New Issue
Block a user