codelif / hyprnotify

DBus Implementation of Freedesktop Notification spec for 'hyprctl notify'
Apache License 2.0
68 stars 5 forks source link

Is there any way to make the notifications pass through Hyprlock? #1

Closed ghost closed 5 months ago

ghost commented 7 months ago

I would like to receive notifications even when my screen is locked.

codelif commented 7 months ago

Umm, it does work with hyprlock.

https://github.com/codelif/hyprnotify/assets/68972644/1ad302d0-4548-4ce5-80b6-1cb9ba5929f7

ghost commented 7 months ago

You need to have a configuration set up to lock the screen. Without a configuration, it will work because it doesn't actually lock the screen.

Feel free to test it with my configuration, but remember to change the wallpaper path, otherwise, it won't function properly.

Hyprlock

background { monitor = path = ~/Dropbox/Wallpapers/Japanese/wp7077944-japan-landscape-anime-wallpapers-gray-scale.png blur_size = 4 blur_passes = 3 }

input-field { monitor = size = 250, 50 outline_thickness = 3 dots_size = 0.2 dots_spacing = 0.64 dots_center = true outer_color = rgba(0, 0, 0, 1) inner_color = rgba(235, 235, 235, 1) font_color = rgba(0, 0, 0, 1) fade_on_empty = true check_color = rgb(0, 0, 0) fail_color = rgb(204, 34, 34) fail_text = \u9593\u9055\u3044 hide_input = false position = 0, 50 halign = center valign = bottom }

Current time

label { monitor = text = cmd[update:1000] echo " $(date +"%I:%M %p") " color = rgba(0, 0, 0, 1) font_size = 64 font_family = Ubuntu 10 position = 0, 16 halign = center valign = center }

Type to unlock

label { monitor = text = Type to unlock! color = rgba(0, 0, 0, 1) font_size = 16 font_family = Ubuntu 10 position = 0, 30 halign = center valign = bottom }

codelif commented 7 months ago

If the layer that hyprlock draws on is above the notification layer then it won't be visible.

Does any other notification server work like (dunst, mako)? Either way, it will have to be fixed upstream.

I could try making a patch, but I am preoccupied till tomorrow, and don't have access to my PC. Sorry.

ghost commented 7 months ago

No problem, the issue seems to actually be upstream. It also doesn't appear to pass through to other notification daemons as well (tested with dunst and mako).

codelif commented 7 months ago

Then I am closing this, is that fine?

ghost commented 5 months ago

Apparently, Hypr isn't willing to support it on their end!

I don't know if they want the support to be handled by the notification daemon or not.

https://github.com/hyprwm/hyprlock/issues/311

Is there any chance you could support it on your end?

codelif commented 5 months ago

This project doesn't handle rendering. The rendering code is in hyprland repo.

codelif commented 4 months ago

After brainstorming for a while I may have a solution, though it might not be ideal.

You could make a program which listens on the Notifications DBus for new notifications and saves their text in a file.

Also, add a new label in hyprlock for notifications which displays the latest notification (polling the notifications file or an interrupt based system which can inform hyprlock to redraw )

Through this approach, your notification daemon is still not displayed but instead you have the flexibility of your hyprlock config.

If you are interested I could build a prototype, I am also kinda interested.