mirror of
https://github.com/vincentbernat/i3wm-configuration.git
synced 2025-06-21 01:25:42 +02:00
wallpaper: make it work with xattr and pyxattr
This commit is contained in:
parent
1f451156ec
commit
7886560fd9
1 changed files with 5 additions and 3 deletions
|
@ -213,7 +213,7 @@ def get_random_images(directory: str, number: int) -> list[Image]:
|
|||
if options.count_attribute:
|
||||
try:
|
||||
count = int(
|
||||
xattr.get(filename, options.count_attribute).decode()
|
||||
xattr.getxattr(filename, options.count_attribute).decode()
|
||||
)
|
||||
except (OSError, ValueError):
|
||||
count = 0
|
||||
|
@ -448,10 +448,12 @@ if __name__ == "__main__":
|
|||
)
|
||||
if options.count_attribute:
|
||||
try:
|
||||
count = int(xattr.get(part.image.filename, options.count_attribute))
|
||||
count = int(
|
||||
xattr.getxattr(part.image.filename, options.count_attribute)
|
||||
)
|
||||
except (OSError, ValueError):
|
||||
count = 0
|
||||
xattr.set(
|
||||
xattr.setxattr(
|
||||
part.image.filename,
|
||||
options.count_attribute,
|
||||
bytes(str(count + 1), "ascii"),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue