-
Notifications
You must be signed in to change notification settings - Fork 4
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 notification body message & text min-width (#7) #8
Conversation
internal/dbus.go
Outdated
|
||
// Using RegExp to add padding for all lines | ||
nf.message = regexp. | ||
MustCompile("^\\s*|(\n)\\s*(.)"). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpick: you could store this regex in a package-level variable to not recompile it every time this function is ran
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right, I'll do it!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done! 024ba8b
Hey, Thanks for showing interest in "hyprnotify". Love the work you have done. I wanted to add body to the text as well but never figured out a way it would fit well like this. So, I nuked it completely. A nitpick: https://specifications.freedesktop.org/notification-spec/latest/protocol.html#id-1.10.3.2.5 |
As for the Maybe a fallback mode could be implemented if |
This way? func (n DBusNotify) GetCapabilities() ([]string, *dbus.Error) {
cap := []string{"body"}
return cap, nil
} |
Yes! |
Any idea for an alternative? The problem with non-monospaced fonts is that each character takes up different space in a text, the amount of padding could have to increase or decrease based on the character choices. |
I am creating an issue to track this, meanwhile I am merging this (though seems like a dead-end). Thanks for your contribution! |
Done! It solves #7 issue. Review the PR please.
Added Features:
Notification body message on a new line when present.
Notification minimum width, consequently promoting symmetry and left alignment for text.
I used an invisible character (\u205F) at the end of the spaces to prevent hyprland from trimming the spaces and making them disappear.
1. Without Body
2. With Body
The notification without an icon is subtly larger than the notifications that have an icon, unfortunately I didn't find better ways to compensate for the lack of an icon.
Important
Hyprland default
font-family
must be monospace onhyprland.conf
misc section. See here: https://wiki.hyprland.org/Configuring/Variables/#misc