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