diff --git a/internal/dbus.go b/internal/dbus.go index 3486a1c..8110a18 100644 --- a/internal/dbus.go +++ b/internal/dbus.go @@ -69,8 +69,8 @@ var ( hyprsock HyprConn ongoing_notifications map[uint32]chan uint32 = make(map[uint32]chan uint32) current_id uint32 = 0 - sound bool notification_padding_regexp *regexp.Regexp = regexp.MustCompile("^\\s*|(\n)\\s*(.)") + sound bool ) type DBusNotify string @@ -187,7 +187,7 @@ func parse_hints(nf *Notification, hints map[string]dbus.Variant) { font_size, ok := hints["x-hyprnotify-font-size"].Value().(int32) if ok { - nf.font_size.value = font_size + nf.font_size.value = uint8(font_size) } hint_icon, ok := hints["x-hyprnotify-icon"].Value().(int32) @@ -206,8 +206,6 @@ func parse_hints(nf *Notification, hints map[string]dbus.Variant) { nf.color.value = nf.color.HEX(hint_color) } } - - } func InitDBus(enable_sound bool) { diff --git a/internal/hypripc.go b/internal/hypripc.go index b1fb0b3..bc01f4c 100644 --- a/internal/hypripc.go +++ b/internal/hypripc.go @@ -60,7 +60,7 @@ func (hypr HyprConn) HyprCtl(args ...string) { func (hypr HyprConn) SendNotification(nf *Notification) { icon := i32ToString(nf.icon.value) timeout := i32ToString(nf.time_ms) - font_size := i32ToString(nf.font_size.value) + font_size := fmt.Sprintf("%d", nf.font_size.value) msg := "fontsize:" + font_size + " " + nf.icon.padding + nf.message hypr.HyprCtl("notify", icon, timeout, nf.color.value, msg) diff --git a/internal/notify.go b/internal/notify.go index dc51316..cfa3105 100644 --- a/internal/notify.go +++ b/internal/notify.go @@ -44,8 +44,7 @@ type icon struct { } type fontSize struct { - value int32 - DEFAULT int32 + value uint8 } func newColorStruct() color { @@ -106,7 +105,7 @@ func NewNotification() Notification { n.icon = newIconStruct() n.color = newColorStruct() - n.font_size = fontSize{value: 13, DEFAULT: 13} + n.font_size = fontSize{value: 13} n.set_urgency(1) // default return n