flake update

This commit is contained in:
Lucy Hochkamp 2025-10-12 22:03:04 +02:00
parent ef5eac814d
commit 350885960e
No known key found for this signature in database
6 changed files with 71 additions and 33 deletions

View file

@ -50,6 +50,7 @@ in
unitConfig.Requisite = "graphical-session.target";
serviceConfig.Restart = "on-failure";
wantedBy = [ "swww-daemon.service" ];
path = with pkgs;[ coreutils findutils cfg.package gnused];
script = ''
set -eox
export DEFAULT_INTERVAL=300 # In seconds
@ -61,23 +62,25 @@ in
export SWWW_TRANSITION="fade"
export SWWW_TRANSITION_DURATION="1"
# export SWWW_TRANSITION_STEP="90"
# queue of images to show
images=( $(find $DIR -type f | shuf) )
function get_img() {
item=''${images[0]}
images=("''${images[@]:1}")
if [[ ''${#images[@]} == 0 ]]; then
images=( $(find $DIR -type f | shuf) )
fi
echo $item
}
while true; do
find "''$DIR" -type f \
| while read -r img; do
echo "''$(</dev/urandom tr -dc a-zA-Z0-9 | head -c 8):''$img"
done \
| sort -n | cut -d':' -f2- \
| while read -r img; do
for d in ''$(${cfg.package}/bin/swww query | grep -Po "^[^:]+"); do # see ${cfg.package}/bin/swww-query(1)
# Get next random image for this display, or re-shuffle images
# and pick again if no more unused images are remaining
[ -z "''$img" ] && if read -r img; then true; else break 2; fi
${cfg.package}/bin/swww img --resize "''$RESIZE_TYPE" --outputs "''$d" "''$img"
unset -v img # Each image should only be used once per loop
done
sleep "''${DEFAULT_INTERVAL}"
img=$(get_img)
for d in ''$(swww query | sed -nE 's/^: ([^:]+).*/\1/p'); do # see swww-query(1)
swww img --resize "''$RESIZE_TYPE" --outputs "''$d" "''$img"
done
sleep "''${DEFAULT_INTERVAL}"
done
'';
# restartTriggers = [wpaperdConf];

View file

@ -11,6 +11,8 @@ in
options.xyno.presets.cli.enable =
lib.mkEnableOption "enables xynos cli config with fish and helix and stuff";
config = lib.mkIf cfg.enable {
programs.nix-index-database.comma.enable = true;
home-manager.users.${config.xyno.system.user.name} =
lib.mkIf config.xyno.presets.home-manager.enable
(
@ -117,7 +119,6 @@ in
bottom
curl
croc
comma
dig
fd
ffmpeg

View file

@ -41,7 +41,7 @@ in
qt = {
enable = true;
style = "breeze";
platformTheme = "gnome";
# platformTheme = "gnome";
};
programs.yazi = {