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

feat: add --print-id flag to print notification id into stdout #87

Merged
merged 2 commits into from
Dec 20, 2024
Merged
Show file tree
Hide file tree
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
Prev Previous commit
fix: apply cargo fmt
  • Loading branch information
JarKz committed Dec 20, 2024
commit f57fc9cfb368c5777d14b463b6a0f7ab8be46fd5
27 changes: 14 additions & 13 deletions crates/app/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ pub struct SendCommand {
short,
long,
help = "Prints ID",
long_help = "Prints the ID of created notification",
long_help = "Prints the ID of created notification"
)]
print_id: bool,

Expand Down Expand Up @@ -217,18 +217,19 @@ async fn send(noti: client::NotiClient<'_>, args: SendCommand) -> anyhow::Result
schedule: args.schedule,
};

let notification_id = noti.send_notification(
args.replaces_id,
args.app_name,
args.icon,
args.summary,
args.body,
args.timeout,
args.actions,
args.hints,
hints_data,
)
.await?;
let notification_id = noti
.send_notification(
args.replaces_id,
args.app_name,
args.icon,
args.summary,
args.body,
args.timeout,
args.actions,
args.hints,
hints_data,
)
.await?;

if args.print_id {
print!("{notification_id}")
Expand Down
3 changes: 2 additions & 1 deletion crates/client/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ impl<'a> NotiClient<'a> {
\ttimeout - {timeout}"
);

let notification_id = self.dbus_client
let notification_id = self
.dbus_client
.notify(
&app_name, id, &icon, &summary, &body, actions, new_hints, timeout,
)
Expand Down
Loading