-
Notifications
You must be signed in to change notification settings - Fork 15.2k
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
Ubuntu Unity launcher counter badge #6243
Conversation
Maybe assume that the package name is |
@@ -45,6 +45,13 @@ if (process.platform === 'darwin') { | |||
} | |||
} | |||
|
|||
if (process.platform === 'linux' && bindings.unityLauncherAvailable()) { |
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.
The existence of API should not depend on current environment, if an API is available on one Linux distribution, it should be able to be called on other Linux distributions, even though it may fail.
We can add a app.unityLauncher.isAvailable
API to let user decide how to behave on different platforms.
That's our current behavior, but it is only working for packaged app for now. |
@@ -216,6 +223,8 @@ class Browser : public WindowListObserver { | |||
std::string version_override_; | |||
std::string name_override_; | |||
|
|||
int current_badge_count_ = 0; |
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.
Should this go behind a #if defined(OS_LINUX)
check since those methods are behind that check?
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 guess the compiler would remove this as unused, because it is private.
But I will add an ifdef block, to keep the code clean.
@jnugh This is a great PR! Looking forward to it landing, we'll definitely be using this in the Slack app on Linux |
describe('app.launcher API', function() { | ||
it('should be available on linux', function() { | ||
if (process.platform !== 'linux') { | ||
assert.equal(app.launcher, undefined); |
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.
There was previously an issue where npm run lint
did not properly lint the spec/
folder.
This was fixed in #6289 so if you rebase or merge master into this branch and then run npm run lint
, you should see some errors for this file like the ;
at the end of this line.
Sorry that this wasn't picked up sooner.
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.
Actually I didn't remember to run the linter...
Rebased, Fixed the errors, squashed it into the specs commit 😄
…ux in general. + Document it only works on ubuntu
fix linter errors
Awesome, thanks for this @jnugh 👍 This will be really nice to have on Ubuntu and great job on the docs and tests. |
Hi,
I implemented a way to change the unity launcher counter badge from within electron:
For this to work the app needs to be started with
env CHROME_DESKTOP=[name of desktop file]
or (which I found out about while writing this: set desktopName in package.json the way you would do for making the progressbar work).Please let me know what you think. When there is something to improve, just let me know. 👷