Implementing none backend

This is to use waypaper as a filepicker, as explained in #33
This commit is contained in:
Anufriev Roman 2024-05-17 11:30:32 +09:00
parent 4f8cc3ad44
commit 9b3d09f474
4 changed files with 8 additions and 3 deletions

View File

@ -222,7 +222,7 @@ class App(Gtk.Window):
def check_backends(self):
"""Before running the app, check which backends are installed or show the error"""
if not self.cf.installed_backends:
if len(self.cf.installed_backends) == 1:
self.show_message(self.txt.err_backend)
exit()

View File

@ -84,6 +84,9 @@ def change_wallpaper(image_path, cf, monitor, txt):
subprocess.Popen(["setwallpaper", "--mode", fill, image_path])
print(f"{txt.msg_setwith} {cf.backend}")
elif cf.backend == "none":
pass
else:
print(f"{txt.err_notsup} {cf.backend}")

View File

@ -55,8 +55,10 @@ def get_random_file(backend, folder, include_subfolders, include_hidden=False):
def check_installed_backends():
"""Check which backends are installed in the system"""
installed_backends = []
installed_backends = ["none"]
for backend in BACKEND_OPTIONS:
if backend == "none":
continue
if backend == "wallutils":
binary_name = "setwallpaper"
else:

View File

@ -1,4 +1,4 @@
BACKEND_OPTIONS = ["swaybg", "swww", "feh", "wallutils"]
BACKEND_OPTIONS = ["none", "swaybg", "swww", "feh", "wallutils"]
FILL_OPTIONS = ["fill", "stretch", "fit", "center", "tile"]
SORT_OPTIONS = ["name", "namerev", "date", "daterev"]
SORT_DISPLAYS = {