diff --git a/dots/.config/hypr/hyprland.conf b/dots/.config/hypr/hyprland.conf index 1f3d5b69..eed048cc 100644 --- a/dots/.config/hypr/hyprland.conf +++ b/dots/.config/hypr/hyprland.conf @@ -13,3 +13,4 @@ exec-once = blueman-applet exec-once = xwaylandvideobridge exec-once = clight exec-once = clight-gui --tray +exec = ~/.config/hypr/scripts/init-wallpapers.bash diff --git a/dots/.config/hypr/scripts/init-wallpapers.bash b/dots/.config/hypr/scripts/init-wallpapers.bash new file mode 100755 index 00000000..255786f5 --- /dev/null +++ b/dots/.config/hypr/scripts/init-wallpapers.bash @@ -0,0 +1,39 @@ +#!/usr/bin/env bash + +log() { + printf "%s\n" "${*}" + systemd-cat -t init-wallpapers -p info echo "${*}" +} + +set-wallpapers() { + ### Set default wallpaper ### + + # Monitors to not set a default for, to be set later down the script + local excluded_monitors=("eDP-1") + + local monitor + while read -r monitor; do + local set_mon_wallpaper=true + for excluded_mon in "${excluded_monitors[@]}"; do + if [[ "${excluded_mon}" == "${monitor}" ]]; then + log "Not setting default wallpaper for '${monitor}' as it is excluded" + set_mon_wallpaper=false + break + fi + done + if "${set_mon_wallpaper}"; then + log "Set default wallpaper for monitor: '${monitor}'" + swww img -t none "${XDG_DATA_HOME}/wallpapers/Nebula.jpg" -o "${monitor}" & + fi + done < <(hyprctl monitors -j | jq -r '.[].name') + + ### Set any non defaults ### + swww img -t none ~/.local/share/wallpapers/Industrial-Shaded.png -o eDP-1 +} + +main() { + swww init + set-wallpapers +} + +main diff --git a/dots/.config/hypr/wm/monitors.conf b/dots/.config/hypr/wm/monitors.conf index 197e1dd5..206eb170 100644 --- a/dots/.config/hypr/wm/monitors.conf +++ b/dots/.config/hypr/wm/monitors.conf @@ -1,8 +1,3 @@ monitor = , preferred, auto, 1 bindl=,switch:off:Lid Switch,exec,hyprctl keyword monitor "eDP-1, preferred, auto, 1" bindl=,switch:on:Lid Switch,exec,hyprctl keyword monitor "eDP-1, disable" - -exec = swww init; swww img -t none ~/.local/share/wallpapers/Nebula.jpg -o DP-1 -exec = swww init; swww img -t none ~/.local/share/wallpapers/Nebula.jpg -o DP-2 -exec = swww init; swww img -t none ~/.local/share/wallpapers/Nebula.jpg -o DP-3 -exec = swww init; swww img -t none ~/.local/share/wallpapers/Industrial-Shaded.png -o eDP-1