#Linux best practices for non-linux developers

7 messages · Page 1 of 1 (latest)

silver hinge
#

So I've only worked on macOS and Windows so I know for example in Windows it's more uncommon for apps to be only in the tray, but in macOS it's fairly common.

But developing for Linux I'm not aware of the common patterns.

  • Should tray icon open the app or a menu?
  • Should the app exit on window close, or stay open in the tray?
  • Which window menu items are must have in linux?
  • etc

I'd love if Linux users jump in to answer ideally post screenshots of different behaviour so we can better understand.

mossy hound
#

Should tray icon open the app or a menu?
Easy, they can't open the app (on left click) -> Show a menu.

Should the app exit on window close, or stay open in the tray?
Tricky. If it's communicated clearly that it's (supposed to be) in the tray then this is fine i think. There are enough apps that do this like discord (minus the communication).
The issue is just that not all desktop environments have a tray (by default). Even on Gnome you have to add an extension first (which most users too tbf)

Which window menu items are must have in linux?
tbh, none unless necessary for your app. Also Tauri's menu implementation is a bit weird (too windows-list) and feels out of place on gnome for example.

#

The issue with Linux is really that you're not just targetting an OS, you're also targetting 2 different display protocols (x11 and wayland) that don't have matching features, and 50 different DEs, all of which couldn't be more different from one another...

silver hinge
#

Easy, they can't open the app (on left click) -> Show a menu.
the issue with showing a menu + keeping the app open is if the user runs another instance of the app it will crash. should I use single instance plugin? Is this common?

mossy hound
#

well, the tray menu is controlled by your rust code so you don't have to open a new window.

#

And if more than one instance of your app (not window) will crash your app you should look into the single instance plugin, yes

cursive plinth
#

The tricky part with Linux is that there are so many flavors and can be so drastically different from one another

Mac and Gnome are very similar to one another. But Xfce is completely different. And Kubuntu looks more like Windows

Linux is a kernel. If you want to talk about best practises for Linux systems you'll have to talk about each system individually