From 485b513b2e82aa3dcf86e4b0ae8a1fa7bc4e004b Mon Sep 17 00:00:00 2001 From: Daniel Weipert Date: Fri, 19 Jul 2024 12:08:55 +0200 Subject: [sway.wallpaper] catch identify process error --- .config/sway/bin/wallpaper.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.config/sway/bin/wallpaper.py b/.config/sway/bin/wallpaper.py index d8ac680..aef190f 100755 --- a/.config/sway/bin/wallpaper.py +++ b/.config/sway/bin/wallpaper.py @@ -142,6 +142,9 @@ while True: selected_file_path = random.choice(found_file_paths) identify_process = subprocess.run(['identify', '-format', '%[fx:mean]', selected_file_path], capture_output=True, text=True) + if not identify_process.stdout: + break + brightness = float(identify_process.stdout) if brightness < float(args.brightness_threshold): # non-bright image break -- cgit v1.2.3