summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--.config/oguri/config4
-rwxr-xr-xbin/oguri-cycle20
2 files changed, 15 insertions, 9 deletions
diff --git a/.config/oguri/config b/.config/oguri/config
index 8a4e5d0..0beb0b1 100644
--- a/.config/oguri/config
+++ b/.config/oguri/config
@@ -1,6 +1,4 @@
 [output *]
-image=/home/robert/.config/oguri/ripples.jpg
-# image=/home/robert/.config/oguri/leaves.jpg
-# image=/home/robert/.config/oguri/ginko.png
+image=~/.config/oguri/ripples.jpg
 scaling-mode=tile
 filter=best
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
 }