-
-
Notifications
You must be signed in to change notification settings - Fork 206
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
Notification badge in system tray icon #261
base: main
Are you sure you want to change the base?
Conversation
just tested this on i3 window manager, seems to work well! |
712d59f
to
5d774ad
Compare
import { mainWin } from "./mainWindow"; | ||
import { globals } from "./mainWindow"; | ||
// !!IMPORTANT!! ./appBadge import must occur after ./mainWindow | ||
import { setBadgeCount } from "./appBadge"; |
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.
consider inline requiring this module to fix the circular dependency issues in a cleaner way
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.
I'm surprised to hear casted require
being called cleaner than just normal imports in a typescript context... but sure
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.
@Vendicated to confirm since we'd need the require hacks for settings as well, you'd prefer the first version over the second version below?
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.
If the current inclusion of // eslint-disable-next-line simple-import-sort/imports
in ipc.ts
is the roadblock on getting this merged, I'm happy to revert it to the require
hacks. At this point I just want to not have to maintain my own branch on my system to keep up with updates...
this is pretty cool, thanks for working on this!
that does sound like the most future proof / maintainable solution, i agree. just passing the arrayBuffer to the renderer, creating the image with canvas api and passing it back to node. i think that's actually also what the Discord app does |
why is mac unsupported anyway? can you not customise the menu bar icons? |
yes but they can only contain black and alpha |
any updates on this PR? would love to see this merged cus i miss notifications a lot, and there's seemingly absolutely no other indicator for new messages atm |
This comment was marked as spam.
This comment was marked as spam.
- New file TrayNotificationBadgeToggle.tsx according to refactor
The PR was behind on some refactors in the newest versions. I've merged the changes following the refactors so it should work again now |
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.
Merge conflict?
macOS has it's own notification badge built in (the same in iOS), and is already used; so I think in any case it shouldn't be necessary. (I do not know the answer on your question though) |
On Linux desktop, notification badges don't work for most people because there isn't a good standard. The library that Electron calls (
libunity
) is old and not many people have it. We don't have much control over the panel image either because that's controlled by the .desktop file. Personally, I find myself relying on notification badges frequently. System tray icon is easily modifiable, unlike the main panel.This PR:
static/badges
. This allows users who wish to modify the default icon to get the badges as well.mainWin
andtray
inappBadge.ts
now. MovesmainWin
andtray
inmainWindow.ts
to a new objectglobals
to avoid circular dependencies and reordered some imports. Can revert these changes if therequire()
hacks are preferred.I am only able to test this on Linux running KDE at the moment. Would appreciate others test this on other platforms!
Can implement the badge image creation live instead of in build step in case other modifications to the tray icon are needed (voice connected, etc.)