Regenerated
This commit is contained in:
+26
-19
@@ -722,45 +722,52 @@ in
|
||||
** =generated/modules/traveldroid/desktop/wallpaper.nix=
|
||||
Setting up wallpaper engine + wallpaper gui
|
||||
#+BEGIN_SRC nix :tangle generated/modules/traveldroid/desktop/wallpaper.nix :noweb tangle :mkdirp yes :eval never-html
|
||||
{ lib, config, pkgs, flakeRoot, home-manager, inputs, ... }:
|
||||
let
|
||||
username = config.defaultUser or "henrov";
|
||||
homeDir = "/home/${username}";
|
||||
wallpaperDst = "${homeDir}/Wallpapers";
|
||||
{ config, pkgs, lib, flakeRoot, ... }:
|
||||
|
||||
let
|
||||
username = config.defaultUser or "henrov";
|
||||
homeDir = "/home/${username}";
|
||||
wallpaperDst = "${homeDir}/Wallpapers";
|
||||
scriptSrc = "${flakeRoot}/assets/traveldroid/Wallpapers/set-wallpapers-per-workspace.sh";
|
||||
in
|
||||
{
|
||||
############################
|
||||
# Packages
|
||||
############################
|
||||
environment.systemPackages = with pkgs; [
|
||||
swww # For setting wallpapers
|
||||
waypaper # Optional, if you use it
|
||||
jq # Needed by the script
|
||||
];
|
||||
|
||||
# Copy Wallpapers from flake root to user's home
|
||||
############################
|
||||
# Copy Wallpapers and Script
|
||||
############################
|
||||
systemd.user.services.copyWallpapers = {
|
||||
description = "Copy Wallpapers to home";
|
||||
description = "Copy Wallpapers and script to home";
|
||||
after = [ "network.target" ];
|
||||
serviceConfig.Type = "oneshot";
|
||||
serviceConfig.ExecStart = ''
|
||||
mkdir -p ${wallpaperDst}
|
||||
cp -r ${flakeRoot}/assets/traveldroid/Wallpapers/* ${wallpaperDst}/
|
||||
chown -R ${username}:${username} ${wallpaperDst}
|
||||
chmod +x ${wallpaperDst}/set-wallpapers-per-workspace.sh
|
||||
'';
|
||||
install.wantedBy = [ "default.target" ];
|
||||
};
|
||||
|
||||
# Place the script in the user's home
|
||||
home.file.".config/wallpapers/set-wallpapers-per-workspace.sh".text = ''
|
||||
#!/usr/bin/env bash
|
||||
WALLS=("${wallpaperDst}"/*)
|
||||
NUM_WALLS=${#WALLS[@]}
|
||||
WS_IDS=($(hyprctl workspaces -j | jq -r '.[].id'))
|
||||
|
||||
for i in "${!WS_IDS[@]}"; do
|
||||
WALL="${WALLS[$((i % NUM_WALLS))]}"
|
||||
swww img "$WALL" --workspace "${WS_IDS[$i]}" --transition-type fade slide blend
|
||||
done
|
||||
'';
|
||||
############################
|
||||
# Optional: Auto-run script at login
|
||||
############################
|
||||
# This assumes you want it to run for your user automatically
|
||||
systemd.user.services.wallpaperPerWorkspace = {
|
||||
description = "Set wallpapers per workspace on login";
|
||||
after = [ "copyWallpapers.service" ];
|
||||
wants = [ "copyWallpapers.service" ];
|
||||
serviceConfig.Type = "oneshot";
|
||||
serviceConfig.ExecStart = "${wallpaperDst}/set-wallpapers-per-workspace.sh";
|
||||
install.wantedBy = [ "default.target" ];
|
||||
};
|
||||
}
|
||||
#+END_SRC
|
||||
|
||||
|
||||
@@ -1,40 +1,47 @@
|
||||
{ lib, config, pkgs, flakeRoot, home-manager, inputs, ... }:
|
||||
let
|
||||
username = config.defaultUser or "henrov";
|
||||
homeDir = "/home/${username}";
|
||||
wallpaperDst = "${homeDir}/Wallpapers";
|
||||
{ config, pkgs, lib, flakeRoot, ... }:
|
||||
|
||||
let
|
||||
username = config.defaultUser or "henrov";
|
||||
homeDir = "/home/${username}";
|
||||
wallpaperDst = "${homeDir}/Wallpapers";
|
||||
scriptSrc = "${flakeRoot}/assets/traveldroid/Wallpapers/set-wallpapers-per-workspace.sh";
|
||||
in
|
||||
{
|
||||
############################
|
||||
# Packages
|
||||
############################
|
||||
environment.systemPackages = with pkgs; [
|
||||
swww # For setting wallpapers
|
||||
waypaper # Optional, if you use it
|
||||
jq # Needed by the script
|
||||
];
|
||||
|
||||
# Copy Wallpapers from flake root to user's home
|
||||
############################
|
||||
# Copy Wallpapers and Script
|
||||
############################
|
||||
systemd.user.services.copyWallpapers = {
|
||||
description = "Copy Wallpapers to home";
|
||||
description = "Copy Wallpapers and script to home";
|
||||
after = [ "network.target" ];
|
||||
serviceConfig.Type = "oneshot";
|
||||
serviceConfig.ExecStart = ''
|
||||
mkdir -p ${wallpaperDst}
|
||||
cp -r ${flakeRoot}/assets/traveldroid/Wallpapers/* ${wallpaperDst}/
|
||||
chown -R ${username}:${username} ${wallpaperDst}
|
||||
chmod +x ${wallpaperDst}/set-wallpapers-per-workspace.sh
|
||||
'';
|
||||
install.wantedBy = [ "default.target" ];
|
||||
};
|
||||
|
||||
# Place the script in the user's home
|
||||
home.file.".config/wallpapers/set-wallpapers-per-workspace.sh".text = ''
|
||||
#!/usr/bin/env bash
|
||||
WALLS=("${wallpaperDst}"/*)
|
||||
NUM_WALLS=${#WALLS[@]}
|
||||
WS_IDS=($(hyprctl workspaces -j | jq -r '.[].id'))
|
||||
|
||||
for i in "${!WS_IDS[@]}"; do
|
||||
WALL="${WALLS[$((i % NUM_WALLS))]}"
|
||||
swww img "$WALL" --workspace "${WS_IDS[$i]}" --transition-type fade slide blend
|
||||
done
|
||||
'';
|
||||
############################
|
||||
# Optional: Auto-run script at login
|
||||
############################
|
||||
# This assumes you want it to run for your user automatically
|
||||
systemd.user.services.wallpaperPerWorkspace = {
|
||||
description = "Set wallpapers per workspace on login";
|
||||
after = [ "copyWallpapers.service" ];
|
||||
wants = [ "copyWallpapers.service" ];
|
||||
serviceConfig.Type = "oneshot";
|
||||
serviceConfig.ExecStart = "${wallpaperDst}/set-wallpapers-per-workspace.sh";
|
||||
install.wantedBy = [ "default.target" ];
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user