Skip to content

Commit

Permalink
Improving error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
anufrievroman committed Sep 24, 2023
1 parent ef598e0 commit 355f6a9
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion waypaper/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from waypaper.arguments import args


__version__ = "1.9.2"
__version__ = "2.0"


def run():
Expand Down
4 changes: 2 additions & 2 deletions waypaper/changer.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def change_wallpaper(image_path, fill_option, color, backend, monitor):
subprocess.Popen(["killall", "swaybg"])
time.sleep(0.005)
except Exception as e:
print(e)
print(f"{ERR_KILL} {e}")
command = ["swaybg"]
# if monitor != "All":
# command.extend(["-o", monitor])
Expand All @@ -40,7 +40,7 @@ def change_wallpaper(image_path, fill_option, color, backend, monitor):
subprocess.Popen(["killall", "swaybg"])
time.sleep(0.005)
except Exception as e:
print(e)
print(f"{ERR_KILL} {e}")
subprocess.Popen(["swww", "init"])
command = ["swww", "img", image_path]
command.extend(["--resize", fill])
Expand Down
3 changes: 2 additions & 1 deletion waypaper/translation_en.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
MSG_CHANGEFOLDER = "Change wallpaper folder"
MSG_CHOOSEFOLDER = "Please choose a folder"
MSG_CACHING = "Caching wallpapers..."
MSG_SETWITH = "Wallpaper was set with"
MSG_SETWITH = "Sent command to set wallpaper was set with"

MSG_HELP = "Waypaper's hotkeys:\n\nhjkl - Navigation (←↓↑→)\nf - Change wallpaper folder\n"
MSG_HELP += "g - Scroll to top\nG - Scroll to bottom\nR - Set random wallpaper\nr - Recache wallpapers\n"
Expand All @@ -34,6 +34,7 @@
ERR_WALL = "Error changing wallpaper:"
ERR_NOTSUP = "The backend is not supported:"
ERR_DISP = "Error determining monitor names:"
ERR_KILL = "Warning related to killall:"

TIP_SUBFOLDER = "Include/exclude images in subfolders"
TIP_REFRESH = "Recache the folder of images"
Expand Down

0 comments on commit 355f6a9

Please sign in to comment.