Nativefier: Add options for system tray icon and behavior

Created on 1 Jun 2017  路  5Comments  路  Source: jiahaog/nativefier

Follows discussion in https://github.com/jiahaog/nativefier/issues/318 . For example, how Icons8 implements this in their interface:

screen shot 2017-05-31 at 11 34 45

The available options from above are:

When window loses focus

  • Default behavior
  • Keep on top
  • Hide
  • Fade

Application icon is in

  • Menubar and Dock
  • Menubar
  • Dock

BUT, sort of like you suggested, I think the bulk of this feature could be achieved with one additional option. Something like:

[tray-icon-only]

--tray-icon-only <path>

So this would encompass the following:

  • Add the specified icon to the menubar/system tray
  • hide the standard dock/taskbar icon
  • hide the window when it loses focus (or just leave this the system default 'bring to front' behavior)

But, I think this feature _could_ include the following additions (or something like them) to the options API:

[tray-icon]

--tray-icon <path>

As for the option of where to display the application icon:

[show-icon-in]

--show-icon-in <value>

I'm not sure how to describe this without using Mac-specific language, and maybe passing in a string like this would be a bad idea, but maybe available values could include both Mac and cross-platform equivalents. For example:

  • "menubar"
  • "dock"
  • "menubar and dock"
  • "taskbar"
  • "system tray"
  • "taskbar and system tray"

For what to do when the window focus is lost, this one is hard. Maybe...

[hide-unfocused]



Anyway, let me know what you think about any of this. Happy to help work through this more if needed. Also, thanks for making Nativefier. I'm a big fan!

feature-request

Most helpful comment

@ronjouch Absolutely. I'll take a deeper look at the source and see if I might be able to tackle this myself.

@Aidoboy I think having a sort of 'active' state of the system tray icon could be good. But maybe we should break that idea into a different issue, since there might be more discussion needed around it in particular.

All 5 comments

That could be really cool for messaging apps, like Discord and GroupMe! I know Discord has a dynamic favicon that indicates unread status, could there be some way to pull that for the system tray icon?

Discord has a dynamic favicon that indicates unread status, could there be some way to pull that for the system tray icon?

@Aidoboy the --counter option already does kind-of-that on macOS in the Dock; yes, would be nice to have similar behavior in this hypothetical tray feature. Regarding updating the whole icon using the app's favicon, that might mean horrible-looking tray icons (favicons are often smaaaall!). Not as ugly as in the (bigger) dock (see discussion at https://github.com/jiahaog/nativefier/issues/367#issuecomment-302695787 ), but staying with --counter's behavior of overlaying a count on the icon (based on a detected number in the page title) might yield better results.

@jamiewilson @Aidoboy just a note to manage expectations: as long as no one does feature requests, they remain requests. There are lots to do and we're only a few maintainers; if you want to give a stab at implementing this feature, the developer guide awaits you 馃檪.

@ronjouch Absolutely. I'll take a deeper look at the source and see if I might be able to tackle this myself.

@Aidoboy I think having a sort of 'active' state of the system tray icon could be good. But maybe we should break that idea into a different issue, since there might be more discussion needed around it in particular.

@ronjouch Yeah, I was just talking about the tray icon. I wonder what overlaying the tray icon with the favicon would look like? Nova Launcher on Android does something like that. Here's and Android Authority article on it.

@jamiewilson That might be a good idea. Edit: I don't have time right now though. :stuck_out_tongue:

Closing this as https://github.com/jiahaog/nativefier/pull/457 added a --tray flag. I don't think the new flag covers everything discussed in this issue, but it's a start. Please try it, then once familiar it, feel free to discuss missing stuff and we can re-open with a list of incremental improvements. All props go to @omouren for the work on #457.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ranzou06 picture ranzou06  路  3Comments

shnbhg picture shnbhg  路  5Comments

vegbrasil picture vegbrasil  路  4Comments

toddself picture toddself  路  5Comments

raulcraveiro picture raulcraveiro  路  4Comments