Control Spotify and Pulseaudio with a Behringer X-Touch One

I've recently bought a Behringer X-Touch One MIDI DAW controller to control REAPER when I'm recording audio.

After the Covid-19 lockdown started, we were told to work from home. I got a Intel NUC from work to take home and connected it to my monitor and bought a USB switch box to switch my keyboard and mouse between my home PC and my work NUC.

Because my speakers are connected to my home PC, I was running Spotify from there and controlled it using either my tablet or the Spotify web player on my work NUC. This worked allright, but I wanted to be able to more quickly pause, play or skip a track.

Using the X-Touch One for this seemed like a perfect solution. Using Python and mido I could control everything on the controller and listen for inputs from it. After that I found out that media players on Linux Mint can be controlled using D-Bus and the dbus-python library.

After I got it all set up, I could control Spotify with the controller and information about the current song playing was sent to the display of the controller. I made the text in the display scrollable using the knob above it.

The next thing I wanted to do was control the audio volume with the slider. I achieved this using the pulsectl library to get the current main audio sinks volume, setting the slider to it and update the volume when the slider moved.

Then I wanted to allow other media players using D-Bus to be able to be controlled. With some more work I was able to control them all. Chrome, VLC, XPlayer, Rhythmbox, Celluloid. They all worked thanks to D-Bus.

The last thing that bugged me at that point was that it was becoming a bit of a mess in de code. I had to run a GLib MainLoop, or else DBus would not work. I had to connect to PulseAudio twice because I could not wait for events and write to it at the same time in a single connection. Also I wanted to compile a to a single static binary so I would not need to install a whole development environment every time I wanted to install the program.

That's when I decided to rewrite the whole thing in Go. And so I did using the gomidi, godbus and pulseaudio libraries. It solved all of these problems.

I have it working now for two weeks, use it every day while working and had no problems at all.

The source code is available on Github:

The python version: DemonTPx/midi-dbus-controller
The go version: DemonTPx/midi-media-controller

Saturday, 2 May 2020, 17:32

Fix slow scrolling in Chrome on Linux

Scrolling is really slow in Chrome on Linux. At about 55 pixels per scroll input, you really have to scroll a lot to get anywhere quick.

Chrome used to have a --scroll-pixels option, which I added in my application launch configuration, but they've taken that out a few years ago.

There are some threads to be found about this subject and the solutions usualy are to use imwheel to replace the scrolling input with keyboard down arrow inputs or to install a Chrome extension like SmoothScroll and just increase the speed there.

Both aren't ideal. Imwheel for example doesn't work right when the cursor is in a text box and the extensions are all a bit slow and sluggish when pages are still loading. The SmoothScroll extension also sometimes just pops up its own website in a new tab, which I find very irritating.

Chrome Scroll Speed extension

Since there seems no way to just fix it directly in Chrome itself, I decided to write an extension which would only increase the scrolling speed. It is based on the SmoothScroll extension, but strips off all the stuff it doesn't need. You can only configure the speed factor and that's it.

The extension essentially also disables smooth scrolling, but I don't care for that anyway.

The Scroll Speed Chrome extension can now be found in the Chrome web store and the source on github.

Saturday, 2 May 2020, 16:50

SteelSeries Arctis 5 and 7 now supported by Ubuntu!

Ubuntu 18.04 (Bionic), Linux Mint 19 and newer releases now officially support the SteelSeries Arctis 5 and 7.

On bionic, the pulseaudio package should at least be updated to 11.1-1ubuntu7.2 to add support for it. Be sure to remove the deb I've created before updating, to prevent a conflict:

dpkg --remove pulseaudio-steelseries-arctis-5

Here is the Launchpad bug which caused the Arctis profiles to be added: #1758736

Please note that the newer 2019 model of the Arctis is not supported, but you can create the file /lib/udev/rules.d/91-pulseaudio-steelseries-arctis-5.rules with the following content to enable support:

ATTRS{idVendor}=="1038", ATTRS{idProduct}=="12aa", ENV{PULSE_PROFILE_SET}="steelseries-arctis-5-usb-audio.conf"

Wednesday, 6 March 2019, 23:06

Launch SSH improved keyboard navigation and natural sort

I've added some updates to Launch SSH and bumped the version to 0.1.2. The keyboard navigation has received a small update as the PAGE DOWN, PAGE UP, HOME and END keys are now functional. Also, when a history item is selected and RETURN is pressed, that session is now launched instead of whats in the input box.

Another small new feature is natural sorting in the history. For example if you were to have 20 webservers called web1, web2, all the way up to web20, it would previously sort like this: web1, web10, web11, .... From now on it will be sorted in a more natural way like this: web1, web2, ..., web9, web10, ..., web19, web20.

Finally, I've no longer created a deb installer for Ubuntu artful, but did created one for Ubuntu bionic, which is about to be released today! You can find the installers here:

Thursday, 26 April 2018, 01:03

Launch SSH 0.1 released

More than ten years after the final release for Geek Launcher, I've finally put some sort of a spiritual successor together called Launch SSH.

I mainly used Geek Launcher to launch SSH sessions, back in the day when I still used Windows XP a lot. It mostly just invoked PuTTy with the hostname of the machine I wanted to connect to. Quickly launching other types of applications was still useful back then, but has been totally unnecessary for the last few years since Windows 7 came with a useful start menu which could quickly filter through and launch applications.

MacOS has similar functionality with spotlight and Gnome, Cinnamon and KDE (and other desktop environments) on linux also have their own ways of launching applications in a similar fashion.

However, launching ssh sessions was still not as easy as it was using my Geek Launcher and Launch SSH is trying to fix that.

Launch SSH main window

The idea is that you install this package and add a global hotkey in the desktop environment to launch the application. After that you get a window with an input box and a list box which will fill up with hostnames you've connected to recently.

After you've connected to a few machines, the history should fill up. And that's where the efficiency should come from. Because you can navigate quickly through the list using the arrow keys and launch a session using the RETURN key and you can also quickly find the session you want using autocomplete (bound to the TAB key.) Removing items from the history is also easy and can be done using the DELETE key.

This should make starting new SSH session a breeze. Go try it out and tell me what you think. You can find it on my github or download it here:

Thursday, 5 April 2018, 00:52