From 7affe3040321ff55028c1458e4278a0ed7196457 Mon Sep 17 00:00:00 2001 From: S4NKALP Date: Mon, 23 Jun 2025 22:06:19 +0545 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat(plugins/launcher):=20add=20Pom?= =?UTF-8?q?odoro=20Technique=20plugin=20with=20timer=20support?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/json/launcher.json | 4 ---- modules/launcher/main.py | 17 +++++++++++++---- modules/launcher/plugin_manager.py | 3 +-- .../launcher/plugins/{ => archive}/pomodoro.py | 0 4 files changed, 14 insertions(+), 10 deletions(-) rename modules/launcher/plugins/{ => archive}/pomodoro.py (100%) diff --git a/config/json/launcher.json b/config/json/launcher.json index 2d99799..a1b9675 100644 --- a/config/json/launcher.json +++ b/config/json/launcher.json @@ -42,10 +42,6 @@ "icon": "wallpapers", "description": "Wallpapers - Set wallpapers, and tons of features" }, - "pomo": { - "icon": "timer_on", - "description": "Pomodoro - Productivity timer with notifications" - }, "web": { "icon": "world", "description": "Web Search - Search the web using various search engines" diff --git a/modules/launcher/main.py b/modules/launcher/main.py index de2f283..b21597c 100644 --- a/modules/launcher/main.py +++ b/modules/launcher/main.py @@ -246,7 +246,9 @@ class Launcher(Window): if hasattr(self.search_entry, "set_position"): self.search_entry.set_position(-1) # Move caret to end if hasattr(self.search_entry, "select_region"): - self.search_entry.select_region(text_length, text_length) # No selection + self.search_entry.select_region( + text_length, text_length + ) # No selection return False # Only run once GLib.idle_add(position_cursor) @@ -324,7 +326,11 @@ class Launcher(Window): if not query.endswith(" "): # This is an exact trigger match without space - add space immediately trigger_text_with_space = self._add_space_to_trigger(query) - GLib.timeout_add(TRIGGER_SEARCH_DEBOUNCE_MS, self._perform_search, trigger_text_with_space) + GLib.timeout_add( + TRIGGER_SEARCH_DEBOUNCE_MS, + self._perform_search, + trigger_text_with_space, + ) else: # Already has space, proceed with normal search GLib.timeout_add(SEARCH_DEBOUNCE_MS, self._perform_search, query) @@ -370,8 +376,11 @@ class Launcher(Window): current_text = self.search_entry.get_text() # If the current text is exactly the trigger word (no space), add space automatically - if (current_text.strip() == trigger_word and not current_text.endswith(" ") - and not getattr(self, "_auto_adding_space", False)): + if ( + current_text.strip() == trigger_word + and not current_text.endswith(" ") + and not getattr(self, "_auto_adding_space", False) + ): query = self._add_space_to_trigger(trigger_word) # Enter trigger mode diff --git a/modules/launcher/plugin_manager.py b/modules/launcher/plugin_manager.py index 4e2794d..3686a7a 100644 --- a/modules/launcher/plugin_manager.py +++ b/modules/launcher/plugin_manager.py @@ -86,7 +86,6 @@ class PluginManager: "screencapture", "emoji", "wallpaper", - "pomodoro", "websearch", "kanban", "calendar", @@ -96,7 +95,7 @@ class PluginManager: "otp", "notifications", "password", - "bookmarks" + "bookmarks", ] for plugin_name in default_plugins: diff --git a/modules/launcher/plugins/pomodoro.py b/modules/launcher/plugins/archive/pomodoro.py similarity index 100% rename from modules/launcher/plugins/pomodoro.py rename to modules/launcher/plugins/archive/pomodoro.py