mirror of
https://github.com/youwen5/iamb.git
synced 2025-08-04 11:38:28 -07:00
Show more text in notifications and use "normal" urgency for dbus notifications (#430)
This commit is contained in:
parent
e99674b245
commit
952374aab0
1 changed files with 4 additions and 1 deletions
|
@ -118,6 +118,9 @@ fn send_notification_desktop(summary: &str, body: Option<&str>) {
|
||||||
.icon(IAMB_XDG_NAME)
|
.icon(IAMB_XDG_NAME)
|
||||||
.action("default", "default");
|
.action("default", "default");
|
||||||
|
|
||||||
|
#[cfg(all(unix, not(target_os = "macos")))]
|
||||||
|
desktop_notification.urgency(notify_rust::Urgency::Normal);
|
||||||
|
|
||||||
if let Some(body) = body {
|
if let Some(body) = body {
|
||||||
desktop_notification.body(body);
|
desktop_notification.body(body);
|
||||||
}
|
}
|
||||||
|
@ -260,7 +263,7 @@ pub fn event_notification_body(event: &AnySyncTimelineEvent, sender_name: &str)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn truncate(s: String) -> String {
|
fn truncate(s: String) -> String {
|
||||||
static MAX_LENGTH: usize = 100;
|
static MAX_LENGTH: usize = 5000;
|
||||||
if s.graphemes(true).count() > MAX_LENGTH {
|
if s.graphemes(true).count() > MAX_LENGTH {
|
||||||
let truncated: String = s.graphemes(true).take(MAX_LENGTH).collect();
|
let truncated: String = s.graphemes(true).take(MAX_LENGTH).collect();
|
||||||
truncated + "..."
|
truncated + "..."
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue