Tray icons for flatpak apps


#1

I’m trying to use flatpak for some apps that rely on tray icons (like Steam and Discord for example), but for some reason they’re not showing up in the system tray. I’m using i3wm, so when I “minimize” these apps, they effectively disappear.

I do have other icons in my tray, such as nm-applet. So the tray is definitely functioning. Seems in general, searching through issues of the respective projects, it should work.

I tried using different extraPortals (xdg-desktop-portal-gtk, xdg-desktop-portal-kde) but didn’t help.

The apps I’ve tried, they do have dbus-related warnings. For example, discord:

$ flatpak run com.discordapp.Discord
Discord 0.0.5
Starting updater.

(discord:4): GConf-WARNING **: 14:19:39.820: Client failed to connect to the D-BUS daemon:
Using X11 for dbus-daemon autolaunch was disabled at compile time, set your DBUS_SESSION_BUS_ADDRESS instead
[Modules] Modules initializing
[Modules] Distribution: remote
[Modules] Host updates: enabled
[Modules] Module updates: enabled
[Modules] Module install path: /home/shazow/.var/app/com.discordapp.Discord/config/discord/0.0.5/modules
[Modules] Module installed file path: /home/shazow/.var/app/com.discordapp.Discord/config/discord/0.0.5/modules/installed.json
[Modules] Module download path: /home/shazow/.var/app/com.discordapp.Discord/config/discord/0.0.5/modules/pending
[Modules] No updates to install
[Modules] Checking for host updates.
[Modules] Host is up to date.
[Modules] Checking for module updates at https://discordapp.com/api/modules/stable/versions.json
[Modules] No module updates available.

(discord:4): libappindicator-WARNING **: 14:19:40.407: Unable to get the session bus: Error spawning command line “dbus-launch --autolaunch=310a048bbdf2410ebcf7809424940288 --binary-syntax --close-stderr”: Child process exited with code 1

(discord:4): LIBDBUSMENU-GLIB-WARNING **: 14:19:40.407: Unable to get session bus: Error spawning command line “dbus-launch --autolaunch=310a048bbdf2410ebcf7809424940288 --binary-syntax --close-stderr”: Child process exited with code 1
[Modules] Starting to install discord_cloudsync...
[Modules] Fetching discord_cloudsync@0 from https://discordapp.com/api/modules/stable/discord_cloudsync/0
sh: xdg-mime: command not found
[Modules] Streaming discord_cloudsync@0 [255 bytes] to /home/shazow/.var/app/com.discordapp.Discord/config/discord/0.0.5/modules/pending/discord_cloudsync-0.zip
[Modules] Finished module downloads. [success: 0] [failure: 1]
[Modules] Checking for host updates.
[Modules] Host is up to date.
[Modules] Checking for module updates at https://discordapp.com/api/modules/stable/versions.json
[Modules] No module updates available.

Similarly, here’s a snip of some Steam warnings:

...
(steam:126): libappindicator-WARNING **: 19:22:24.534: Unable to get the session bus: Error spawning command line “dbus-launch --autolaunch=310a048bbdf2410ebcf7809424940288 --binary-syntax --close-stderr”: Child process exited with code 1

(steam:126): LIBDBUSMENU-GLIB-WARNING **: 19:22:24.603: Unable to get session bus: Error spawning command line “dbus-launch --autolaunch=310a048bbdf2410ebcf7809424940288 --binary-syntax --close-stderr”: Child process exited with code 1
...

Any suggestions for how to debug this? Anyone else run into these problems?

Environment:

  • NixOS unstable branch
  • X.Org X Server 1.19.6
  • Flatpak 1.1.2
  • i3 version 4.16 (2018-11-04)
  • i3status-rs 0.9 for the bar content

My full config is generally here. // flatpak stuff is here.


#2

Ah, got it working:

I had to run export $(dbus-launch) in the same shell before running the flatpak command.

Not sure why this is required (or what I have misconfigured that requires me to run that in addition), but at least icons are showing up now!

Update: Okay, I think it’s because I wasn’t using the built-in window/desktop manager code, but rather was doing my own startx effectively. I had to change my .xinitrc from exec i3 to exec dbus-launch i3, and now everything works!