mirror of
https://github.com/moons-14/dotfiles.git
synced 2026-10-06 11:14:08 +09:00
fix bug
This commit is contained in:
@@ -26,11 +26,11 @@ in {
|
|||||||
|
|
||||||
systemd.user.services.swww = {
|
systemd.user.services.swww = {
|
||||||
Unit = {
|
Unit = {
|
||||||
Description = "swww daemon";
|
Description = "swww init (Wayland wallpaper daemon)";
|
||||||
After = [ "graphical-session.target" ];
|
After = [ "graphical-session.target" ];
|
||||||
};
|
};
|
||||||
Service = {
|
Service = {
|
||||||
ExecStart = "${pkgs.swww}/bin/swww-daemon";
|
ExecStart = [ "${pkgs.swww}/bin/swww" "init" ];
|
||||||
Restart = "on-failure";
|
Restart = "on-failure";
|
||||||
};
|
};
|
||||||
Install = {
|
Install = {
|
||||||
@@ -46,7 +46,7 @@ in {
|
|||||||
};
|
};
|
||||||
Service = {
|
Service = {
|
||||||
Type = "oneshot";
|
Type = "oneshot";
|
||||||
ExecStart = "${pkgs.bash}/bin/bash -lc $HOME/.local/bin/set-wallpaper.sh";
|
ExecStart = [ "${pkgs.bash}/bin/bash" "${config.home.homeDirectory}/.local/bin/set-wallpaper.sh" ];
|
||||||
};
|
};
|
||||||
Install = {
|
Install = {
|
||||||
WantedBy = [ "default.target" ];
|
WantedBy = [ "default.target" ];
|
||||||
|
|||||||
@@ -4,8 +4,13 @@ set -euo pipefail
|
|||||||
|
|
||||||
WALLS="${HOME}/wallpapers"
|
WALLS="${HOME}/wallpapers"
|
||||||
|
|
||||||
# Pick up wallpaper(jpg/jpeg/png/webp)
|
if ! swww query >/dev/null 2>&1; then
|
||||||
|
swww init
|
||||||
|
fi
|
||||||
|
|
||||||
mapfile -t files < <(find "$WALLS" -type f \( -iname '*.jpg' -o -iname '*.jpeg' -o -iname '*.png' -o -iname '*.webp' \))
|
mapfile -t files < <(find "$WALLS" -type f \( -iname '*.jpg' -o -iname '*.jpeg' -o -iname '*.png' -o -iname '*.webp' \))
|
||||||
|
|
||||||
|
|
||||||
[[ ${#files[@]} -gt 0 ]] || exit 0
|
[[ ${#files[@]} -gt 0 ]] || exit 0
|
||||||
|
|
||||||
pick="${files[RANDOM % ${#files[@]}]}"
|
pick="${files[RANDOM % ${#files[@]}]}"
|
||||||
|
|||||||
Reference in New Issue
Block a user