Skip to content

Commit

Permalink
feat: add text min-width and left alignment
Browse files Browse the repository at this point in the history
  • Loading branch information
d3cryptofc committed Sep 25, 2024
1 parent 685a463 commit 37d3e31
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions internal/dbus.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,16 @@ func (n DBusNotify) Notify(

// Send Notification
nf := NewNotification()

parse_hints(&nf, hints)

// Setting min-width, left alignment
summary = fmt.Sprintf("%-60s", summary)
if nf.icon.value == nf.icon.NOICON {
summary += " "
}
summary += "\u205F"

if body != "" {
nf.message = fmt.Sprintf("%s\n%s", summary, body)
} else {
Expand All @@ -111,11 +121,9 @@ func (n DBusNotify) Notify(
MustCompile("^\\s*|(\n)\\s*(.)").
ReplaceAllString(
strings.TrimLeft(nf.message, "\n"),
"$1\u205F\u205F$2",
"$1\u205F $2",
)

parse_hints(&nf, hints)

if expire_timeout != -1 {
nf.time_ms = expire_timeout
}
Expand Down

0 comments on commit 37d3e31

Please sign in to comment.