mirror of
https://github.com/anufrievroman/waypaper.git
synced 2024-09-11 16:26:14 +03:00
parent
b5a3b5ef33
commit
47f59cd43b
@ -17,14 +17,14 @@ def change_wallpaper(image_path, cf, monitor, txt):
|
|||||||
subprocess.Popen(["killall", "swaybg"])
|
subprocess.Popen(["killall", "swaybg"])
|
||||||
time.sleep(0.005)
|
time.sleep(0.005)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(f"{ERR_KILL} {e}")
|
print(f"{txt.err_kill} {e}")
|
||||||
command = ["swaybg"]
|
command = ["swaybg"]
|
||||||
# if monitor != "All":
|
# if monitor != "All":
|
||||||
# command.extend(["-o", monitor])
|
# command.extend(["-o", monitor])
|
||||||
command.extend(["-i", image_path])
|
command.extend(["-i", image_path])
|
||||||
command.extend(["-m", fill, "-c", cf.color])
|
command.extend(["-m", fill, "-c", cf.color])
|
||||||
subprocess.Popen(command)
|
# subprocess.Popen(command)
|
||||||
print(f"{txt.msg_setwith} {cf.backend}")
|
# print(f"{txt.msg_setwith} {cf.backend}")
|
||||||
|
|
||||||
# swww backend:
|
# swww backend:
|
||||||
elif cf.backend == "swww":
|
elif cf.backend == "swww":
|
||||||
@ -41,7 +41,7 @@ def change_wallpaper(image_path, cf, monitor, txt):
|
|||||||
subprocess.Popen(["killall", "swaybg"])
|
subprocess.Popen(["killall", "swaybg"])
|
||||||
time.sleep(0.005)
|
time.sleep(0.005)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(f"{ERR_KILL} {e}")
|
print(f"{txt.err_kill} {e}")
|
||||||
subprocess.Popen(["swww", "init"])
|
subprocess.Popen(["swww", "init"])
|
||||||
command = ["swww", "img", image_path]
|
command = ["swww", "img", image_path]
|
||||||
command.extend(["--resize", fill])
|
command.extend(["--resize", fill])
|
||||||
@ -93,8 +93,8 @@ def change_wallpaper(image_path, cf, monitor, txt):
|
|||||||
for index, word in enumerate(command):
|
for index, word in enumerate(command):
|
||||||
if word == "$wallpaper":
|
if word == "$wallpaper":
|
||||||
command[index] = image_path
|
command[index] = image_path
|
||||||
subprocess.Popen(command)
|
subprocess.Popen(f'{" ".join(command)}', shell=True).wait()
|
||||||
print(f'{" ".join(command)} executed')
|
print(f'Post command {" ".join(command)} executed')
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(f"{txt.err_wall} {e}")
|
print(f"{txt.err_wall} {e}")
|
||||||
|
Loading…
Reference in New Issue
Block a user