Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: DesktopNotifier.send_sync() -> DesktopNotifierSync.send() and Icons #4

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions aw_notify/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import aw_client.queries
import click
from aw_core.log import setup_logging
from desktop_notifier import DesktopNotifier
from desktop_notifier import DesktopNotifierSync
from typing_extensions import TypeAlias

logger = logging.getLogger(__name__)
Expand All @@ -46,7 +46,7 @@
# global objects
# will init in entrypoints
aw: Optional[AwClient] = None
notifier: Optional[DesktopNotifier] = None
notifier: Optional[DesktopNotifierSync] = None

# executable path
script_dir = Path(__file__).parent.absolute()
Expand Down Expand Up @@ -145,14 +145,14 @@ def notify(title: str, msg: str):

global notifier
if notifier is None:
notifier = DesktopNotifier(
notifier = DesktopNotifierSync(
app_name="AW",
app_icon=f"file://{icon_path}",
notification_limit=10,
)

logger.info(f'Showing: "{title} - {msg}"')
notifier.send_sync(title=title, message=msg)
notifier.send(title=title, message=msg)


class CategoryAlert:
Expand Down