Revert "feat: Add desktop notification support with notify-py package"

This reverts commit 38e8d27416.
This commit is contained in:
Paul Gauthier 2025-03-06 11:53:58 -08:00
parent 996177ceaf
commit c3401047e0
2 changed files with 2 additions and 26 deletions

View file

@ -795,12 +795,6 @@ def get_parser(default_config_files, git_root):
default=default_env_file(git_root), default=default_env_file(git_root),
help="Specify the .env file to load (default: .env in git root)", help="Specify the .env file to load (default: .env in git root)",
) )
group.add_argument(
"--notification",
choices=["bell", "desktop", "both", "none"],
default="bell",
help="Notification method when LLM completes (default: bell)",
)
group.add_argument( group.add_argument(
"--suggest-shell-commands", "--suggest-shell-commands",
action=argparse.BooleanOptionalAction, action=argparse.BooleanOptionalAction,

View file

@ -8,7 +8,6 @@ from collections import defaultdict
from dataclasses import dataclass from dataclasses import dataclass
from datetime import datetime from datetime import datetime
from io import StringIO from io import StringIO
from notifypy import Notify
from pathlib import Path from pathlib import Path
from prompt_toolkit.completion import Completer, Completion, ThreadedCompleter from prompt_toolkit.completion import Completer, Completion, ThreadedCompleter
@ -237,7 +236,6 @@ class InputOutput:
file_watcher=None, file_watcher=None,
multiline_mode=False, multiline_mode=False,
root=".", root=".",
notification="bell",
): ):
self.placeholder = None self.placeholder = None
self.interrupted = False self.interrupted = False
@ -245,7 +243,6 @@ class InputOutput:
self.editingmode = editingmode self.editingmode = editingmode
self.multiline_mode = multiline_mode self.multiline_mode = multiline_mode
self.bell_on_next_input = False self.bell_on_next_input = False
self.notification_type = notification
no_color = os.environ.get("NO_COLOR") no_color = os.environ.get("NO_COLOR")
if no_color is not None and no_color != "": if no_color is not None and no_color != "":
pretty = False pretty = False
@ -952,25 +949,10 @@ class InputOutput:
"""Clear the bell flag (optional, as we'll clear it after ringing)""" """Clear the bell flag (optional, as we'll clear it after ringing)"""
self.bell_on_next_input = False self.bell_on_next_input = False
def show_desktop_notification(self):
"""Show a desktop notification that the LLM has completed"""
notification = Notify()
notification.title = "Aider"
notification.message = "LLM processing complete"
notification.send()
def ring_bell(self): def ring_bell(self):
"""Ring the terminal bell or show desktop notification if needed and clear the flag""" """Ring the terminal bell if needed and clear the flag"""
if self.bell_on_next_input: if self.bell_on_next_input:
if self.notification_type in ("bell", "both"): print("\a", end="", flush=True) # Ring the bell
print("\a", end="", flush=True) # Ring the bell
if self.notification_type in ("desktop", "both"):
try:
self.show_desktop_notification()
except Exception as e:
self.tool_warning(f"Desktop notification failed: {e}")
self.bell_on_next_input = False # Clear the flag self.bell_on_next_input = False # Clear the flag
def toggle_multiline_mode(self): def toggle_multiline_mode(self):