Streaming audio from Plasma to a Chromecast

Chromecast devices in the sound settings

This morning, while browsing the web, I wanted to listen to a Podcast from my laptop, and thought “Hey, can I stream this to our stereo?”. As it turns out, that’s rather easy to achieve, so I thought I’d share it here.
The media devices in our home are connected using Chromecasts, which are small dongles that allow playing media on them, meaning you can play for example a video from your phone on the projector in the living room: very convenient.

I didn’t know if that was easily achievable with audio from my Plasma/Linux laptop and a quick search turned up “pulseaudio-dlna” which adds Chromecast devices on the local networks as output devices.

On my KDE Neon laptop, it’s as easy as installing pulseaudio-dlna from the standard repositories and then starting “pulseaudio-dlna” from the commandline. Then, I can pick an output device from the panel popup and the audio stream changed to my stereo.

$ sudo apt install pulseaudio-dlna
$ sudo pulseaudio-dlna
Added the device "Stereo (Chromecast)".

DBus-Activated Systemtray Plasmoids

In this article, I’m describing a way to dynamically load Plasmoids into the systemtray. It’s interesting for you if you develop Plasma addons, or if you’re interested in the design of Plasma by KDE.

One of the wishes that came up during the latest Plasma sprint in Barcelona was a more dynamic way of showing functionality in the systemtray, that little notification area sitting in the panel next to the clock. The systemtray can have different kinds of “things” in them: Statusnotifiers, which are basically systray icons of applications, and Plasma widgets, which allows for much more functionality and freedom in UI development. Statusnotifiers are instantiated by applications, so their lifetime is entirely in the hands of the application they belong to. For Plasma widgets, this is a bit different, they’re currently loaded on startup. Ideally, we want to load specific services on-demand, say when a specific service becomes available.

You may have guessed by the title already, this feature has now landed in Plasma Next. It was actually quite easy to do, yet it’s a very powerful feature. First, let’s see what it looks like:

This feature allows loading and unloading Plasmoids when dbus services come and go. Applets can specify in their metadata which service should control their lifecycle.

This has the following advantages:

  • We can dynamically only load widgets when they’re useful, reducing clutter in many cases
  • Applications can provide widgets that appear and disappear based on the application running
  • We can load controls for system services dynamically as they come and go
  • It makes it easier to delay loading of widgets in the systemtray until when a specific service appears, cutting down startup time
  • It makes widgets and their features more discoverable as they’ll be able to appear automatically

One immediate user for this is the media controller widget, which will now only be loaded once an MPRIS2-compatible media player is running (as indicated by a dbus interface becoming available on the session bus.)

How do you do that? It’s quite easy. Two things need to be done: the widget should indicate to be loaded into the systemtray automatically, and it needs to specify a service which triggers loading it. That’s two lines in your metadata.desktop file, looking like this for example:


That’s all. Enjoy your cleaner, more dynamic systemtray!

Tokamak 5 Photo Blog

Tokamak 5 has ended, the house is mostly clean and proper again, so time to post some photographic evidence of what has been an epic sprint.

Tulips, typical for the Netherlands. Not all of them made the end of the sprint.

Tulips, typical for the Netherlands. Not all of them made the end of the sprint.

Artur, looking into QtWebkit performance on Plasma Active

Artur, looking into QtWebkit performance on Plasma Active.

Dario and Ivan

BBQ, yes, that's a Brazilian taking care of the veggie grill.

BBQ, yes, that’s a Brazilian taking care of the veggie grill. (The tricolore shirt is for easier Visa procedures.)

Kevin, API bitch and Kanban master.

Kevin, API bitch (his words) and Kanban master.

Daily stand-up to catch up with other's activities.

Daily stand-up meeting to catch up with others’ activities.

No comment. (XKCD reference welcome.)

No comment. (XKCD reference welcome.)

We know what to do with ... pancakes.

We know what to do with … pancakes. (Don’t worry, Aaron and the pancake had a wonderful rest of the evening. Pancakes were kindly made by Adriaan.)

Groupphoto. Taken one day after Dario and Ruphy left, so we don't look like an Italian-only team.

Groupphoto. Taken one day after Dario and Ruphy had to leave, so we don’t look like an Italian-only team. Also clearly a Thursday.

Primary means of transportation. Looks more stupid in wide-angle.

Primary means of transportation. Looks more stupid in wide-angle.

OranjePop, one of the concerts.

OranjePop, one of the concerts. Verdict: Can’t really sing, but surely fun music to listen and watch.

Interview with Pardus, Nouvelle Vague

I’ve been interviewed again, and this time the resulting article is published in Turkish, in the Pardus E-Zine. There must be a theme that I always post links to interviews when only parts of the audience can read it. One day, I’ll get you all. The photo’s are universally legible, though. They’re also proof that I’m the most relaxed hacker in the world, an important thing if you ask me.

On Sunday night, I went to Utrecht to see Nouvelle Vague, a French band performing in Tivoli. It was a nice concert, musically on a very high level and with a good portion of fun. The girls, Melanie and Nadeah, were both entertaining and charming (how cute can you be, performing the Dead Kennedy’s song “too drunk to fuck“?), playing some kind of new wave version of good cop, bad cop with reversed dress colors, which gave the concert a very nice touch.