randomWallpaper: exit gracefully if no active monitors

This commit is contained in:
Aly Raffauf 2024-08-03 12:31:07 -04:00
parent 2e24108fa7
commit 0b240aca66

View file

@ -27,6 +27,7 @@
if Dir.exist?(directory) if Dir.exist?(directory)
loop do loop do
active_monitors = get_outputs active_monitors = get_outputs
break if active_monitors.empty?
added_monitors = active_monitors - known_monitors.keys added_monitors = active_monitors - known_monitors.keys
removed_monitors = known_monitors.keys - active_monitors removed_monitors = known_monitors.keys - active_monitors