Skip to content
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(linux): Emit D-Bus signal directly for dock notification badges #686

Open
wants to merge 13 commits into
base: main
Choose a base branch
from

Conversation

Covkie
Copy link

@Covkie Covkie commented Jun 21, 2024

Closes #298, #424, #189

remove (#) title prefix when Notification Badge option is toggled

explode scuffed optional libunity dependency (kabloomed)

Closes Vencord#298, Vencord#424, Vencord#189

remove (#) title prefix when `Notification Badge` option is toggled

explode scuffed option libunity dependency (kabloomed)
src/main/appBadge.ts Outdated Show resolved Hide resolved
@Covkie
Copy link
Author

Covkie commented Jun 21, 2024

I need some design input regarding the unread badge option.

Do I provide an unread badge at all and if I do do i make it display a "-" or "0" (also should I strip out the like with the (#)
image
image
This is simply a limitation of the Launcher API unfortunately.

Applied reviewer suggestions.

Unread Badge displays a `0`
@ToxicMushroom
Copy link

Do I provide an unread badge at all and if I do do i make it display a "-" or "0" (also should I strip out the like with the (#)

I think it makes most sense to not display an unread pings badge if the count is 0.
So it makes it more noticeable when you do have one.

Idm either way for the •

@Covkie
Copy link
Author

Covkie commented Jun 23, 2024

@ToxicMushroom The unread count isnt actually "0" in this case. Theres two distinct badge modes; unreads and mentions. Mentions are what have the number count and only shows up for pings and DMs, etc.

Unreads are when there is a message in a channel that you do not have muted. Users can disable the unread badge but still have the mention badge.

The reason why the unread badge shows a "0" is due to a limitation with the Launcher API it can only show 0-9 with no option for blank badge or a dot.

src/main/appBadge.ts Outdated Show resolved Hide resolved
src/main/appBadge.ts Show resolved Hide resolved
src/main/appBadge.ts Outdated Show resolved Hide resolved
src/main/mainWindow.ts Outdated Show resolved Hide resolved
src/renderer/appBadge.ts Show resolved Hide resolved
@flying-sheep
Copy link

Why gdbus? It doesn’t necessarily exist on platforms supporting this DBus API (e.g. KDE Plasma)

Can you switch to a DBus node.js library?

@Covkie
Copy link
Author

Covkie commented Aug 13, 2024

I think we went with cli to not bring in another dep. If the issue is gdbus not existing everywhere we could switch to dbus-send

@flying-sheep
Copy link

flying-sheep commented Aug 13, 2024

dbus-send is probably the better call: I checked Arch Linux, Ubuntu, Debian, and Fedora where it’s provided by the dbus package, which is installed on every system with a DE, and depended on by many many things.

There are two DBus implementations: dbus-daemon (included with dbus) and dbus-broker. There are a few systems that only use dbus-broker, in which case dbus-send is not necessarily present. That currently includes only immutable distros like Fedora Silverblue. Debian has a split-off dbus-bin package that contains dbus-send so maybe going forward immutable distros also come with it.

So all in all I’d say if you go with one tool, dbus-send is the safer bet, multiple tools would be better, and a node.js library would be the perfect, always-works alternative.

src/main/appBadge.ts Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unread Notification Badge not working on KDE
5 participants