refactor(hypr): use script to set wallpapers
This commit is contained in:
parent
5fe55e7d38
commit
3109adb3df
@ -13,3 +13,4 @@ exec-once = blueman-applet
|
|||||||
exec-once = xwaylandvideobridge
|
exec-once = xwaylandvideobridge
|
||||||
exec-once = clight
|
exec-once = clight
|
||||||
exec-once = clight-gui --tray
|
exec-once = clight-gui --tray
|
||||||
|
exec = ~/.config/hypr/scripts/init-wallpapers.bash
|
||||||
|
39
dots/.config/hypr/scripts/init-wallpapers.bash
Executable file
39
dots/.config/hypr/scripts/init-wallpapers.bash
Executable file
@ -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
|
@ -1,8 +1,3 @@
|
|||||||
monitor = , preferred, auto, 1
|
monitor = , preferred, auto, 1
|
||||||
bindl=,switch:off:Lid Switch,exec,hyprctl keyword monitor "eDP-1, 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"
|
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
|
|
||||||
|
Loading…
Reference in New Issue
Block a user