diff --git a/chwall/__init__.py b/chwall/__init__.py index 1cc82e6..fc0a843 100644 --- a/chwall/__init__.py +++ b/chwall/__init__.py @@ -1 +1 @@ -__version__ = "0.5.7" +__version__ = "0.5.8" diff --git a/chwall/daemon.py b/chwall/daemon.py index 022f4ca..43abd44 100644 --- a/chwall/daemon.py +++ b/chwall/daemon.py @@ -208,8 +208,6 @@ def daemon_loop(): pid_file = "{}/chwall_pid".format(BASE_CACHE_PATH) if os.path.isfile(pid_file): os.unlink(pid_file) - # Try to keep cache as clean as possible - cleanup_cache() if error_code == 0: logger.info("Kthxbye!") return error_code @@ -242,6 +240,13 @@ def start_daemon(): f.write(str(os.getpid())) logger.info(_("Starting Chwall Daemon v{version}…") .format(version=__version__)) + # Try to keep cache as clean as possible + deleted = cleanup_cache() + logger.info(gettext.ngettext( + "{number} cache entry has been removed.", + "{number} cache entries have been removed.", + deleted + ).format(number=deleted)) sys.exit(daemon_loop()) diff --git a/chwall/fetcher/muzei.py b/chwall/fetcher/muzei.py index fea7479..d2ffbf5 100644 --- a/chwall/fetcher/muzei.py +++ b/chwall/fetcher/muzei.py @@ -7,7 +7,7 @@ def fetch_pictures(config): today = datetime.date.today() year = today.year month = today.month - 1 - if month == -1: + if month == 0: month = 12 year -= 1 # We get the last month meta file to have enough wallpaper to show (~30). diff --git a/chwall/fetcher/natgeo.py b/chwall/fetcher/natgeo.py index dc56d43..7f371d8 100644 --- a/chwall/fetcher/natgeo.py +++ b/chwall/fetcher/natgeo.py @@ -12,6 +12,7 @@ def fetch_pictures(config): month_idx = t.month - 2 if month_idx == -1: month_idx = 11 + year -= 1 month = month_label[month_idx] final_uri = "https://www.nationalgeographic.co.uk/page-data/" \ f"photo-of-the-day/{year}/{month}/page-data.json" diff --git a/chwall/gui/app.py b/chwall/gui/app.py index e966950..7bdc209 100644 --- a/chwall/gui/app.py +++ b/chwall/gui/app.py @@ -252,6 +252,7 @@ def _build_translations_for_desktop_file(localedir): "comment": [], "next_name": [], "previous_name": [], + "favorite_name": [], "blacklist_name": [] } for lng in sorted(os.listdir(localedir)): @@ -280,6 +281,10 @@ def _build_translations_for_desktop_file(localedir): "Name[{lang}]={key}".format( lang=lng, key=_("Previous wallpaper"))) + lng_attrs["favorite_name"].append( + "Name[{lang}]={key}".format( + lang=lng, + key=_("Save as favorite"))) lng_attrs["blacklist_name"].append( "Name[{lang}]={key}".format( lang=lng, @@ -316,11 +321,12 @@ def generate_desktop_file(localedir="./locale", out="chwall-app.desktop"): Type=Application Categories=GTK;GNOME;Utility; StartupNotify=false -Actions=Next;Previous;Blacklist; +Actions=Next;Previous;Favorite;Blacklist; """.format(app_exec=get_binary_path("app", "xdg")) actions = _build_action_block("next", lng_attrs) \ + _build_action_block("previous", lng_attrs) \ + + _build_action_block("favorite", lng_attrs) \ + _build_action_block("blacklist", lng_attrs) df_content += "\n".join(actions) diff --git a/chwall/gui/preferences.py b/chwall/gui/preferences.py index 22d1f53..206414b 100644 --- a/chwall/gui/preferences.py +++ b/chwall/gui/preferences.py @@ -463,7 +463,7 @@ def make_general_pane(self): adj=Gtk.Adjustment(sleep_time, 5, 120, 1), factor=60) genbox.pack_start(prefbox, False, False, 0) - environments = [("gnome", "Gnome, Budgie, …"), + environments = [("gnome", "Gnome, Pantheon, Budgie, …"), ("mate", "Mate"), ("xfce", "XFCE"), ("nitrogen", _("Use Nitrogen application"))] prefbox = self.make_select_pref( diff --git a/chwall/gui/shared.py b/chwall/gui/shared.py index 801804b..5f5b140 100644 --- a/chwall/gui/shared.py +++ b/chwall/gui/shared.py @@ -25,8 +25,6 @@ class ChwallGui: def __init__(self): self.app = None self.reload_config() - # Try to keep cache as clean as possible - cleanup_cache() def reload_config(self): self.config = read_config() diff --git a/chwall/utils.py b/chwall/utils.py index 522d4a9..ec48e9c 100644 --- a/chwall/utils.py +++ b/chwall/utils.py @@ -287,7 +287,7 @@ def xdg_autostart_file(self, component, app_name, app_desc, write=False): elif component == "icon": file_content += """\ X-GNOME-Autostart-enabled=false -NotShowIn=GNOME +NotShowIn=GNOME;Pantheon; Categories=GTK;TrayIcon;Utility; """ if write is False: diff --git a/locale/es/LC_MESSAGES/chwall.po b/locale/es/LC_MESSAGES/chwall.po index b4b17fd..98aed1f 100644 --- a/locale/es/LC_MESSAGES/chwall.po +++ b/locale/es/LC_MESSAGES/chwall.po @@ -1,11 +1,11 @@ # Chwall Translation Effort -# Copyright (C) 2021 Chwall volunteers +# Copyright (C) 2022 Chwall volunteers # This file is distributed under the same license as the Chwall package. # FIRST AUTHOR , YEAR. # msgid "" msgstr "" -"Project-Id-Version: Chwall 0.5.7\n" +"Project-Id-Version: Chwall 0.5.8\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-07-16 14:13+0200\n" "PO-Revision-Date: 2020-05-02 12:28+0000\n" diff --git a/locale/fr/LC_MESSAGES/chwall.po b/locale/fr/LC_MESSAGES/chwall.po index 16507a3..4c3ecbf 100644 --- a/locale/fr/LC_MESSAGES/chwall.po +++ b/locale/fr/LC_MESSAGES/chwall.po @@ -1,11 +1,11 @@ # Chwall Translation Effort -# Copyright (C) 2021 Chwall volunteers +# Copyright (C) 2022 Chwall volunteers # This file is distributed under the same license as the Chwall package. # Automatically generated, 2019. # msgid "" msgstr "" -"Project-Id-Version: Chwall 0.5.7\n" +"Project-Id-Version: Chwall 0.5.8\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-07-16 14:13+0200\n" "PO-Revision-Date: 2021-07-16 14:08+0200\n"