From 0845d8db118b2d10c5c5972db23ca3378d6618cb Mon Sep 17 00:00:00 2001 From: Robert Günzler Date: Thu, 24 Nov 2022 21:13:56 +0100 Subject: bin/oguri-cycle: handle non-existing wallpapers --- bin/oguri-cycle | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'bin') diff --git a/bin/oguri-cycle b/bin/oguri-cycle index 36394b2..c09c712 100755 --- a/bin/oguri-cycle +++ b/bin/oguri-cycle @@ -17,12 +17,20 @@ fi change_bg() { for o in "${OUTPUTS[@]}"; do - idx=$((0 + RANDOM % ${#BGS[@]})) - ogurictl output "${o}" \ - --image "${BGS[${idx}]}" \ - --filter best \ - --scaling-mode fill \ - --anchor center + if [ ${#BGS} -gt 0 ]; then + idx=$((0 + RANDOM % ${#BGS[@]})) + ogurictl output "${o}" \ + --image "${BGS[${idx}]}" \ + --filter best \ + --scaling-mode fill \ + --anchor center + else + ogurictl output "${o}" \ + --image "$(grep image "${XDG_CONFIG_HOME}"/oguri/config | cut -d= -f2)" \ + --filter best \ + --scaling-mode tile \ + --anchor center + fi done } -- cgit 1.4.1