get_wallpaper error handling
This commit is contained in:
parent
57e677e0cf
commit
9145fa183d
|
@ -89,9 +89,6 @@ def get_wallpaper(screen_number):
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
str: The wallpaper path for the specified screen size.
|
str: The wallpaper path for the specified screen size.
|
||||||
|
|
||||||
Raises:
|
|
||||||
IndexError: If the specified screen number is out of bounds.
|
|
||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
screens_ = run(
|
screens_ = run(
|
||||||
|
@ -108,6 +105,8 @@ def get_wallpaper(screen_number):
|
||||||
size = screens_.stdout.split()[screen_number]
|
size = screens_.stdout.split()[screen_number]
|
||||||
except IndexError:
|
except IndexError:
|
||||||
size = screens_.stdout.split()[0]
|
size = screens_.stdout.split()[0]
|
||||||
|
except AttributeError:
|
||||||
|
size = screens_
|
||||||
|
|
||||||
match size:
|
match size:
|
||||||
case "3440x1440":
|
case "3440x1440":
|
||||||
|
|
Loading…
Reference in New Issue