Sound loopback

In my professional life I attend many video conferences. We use all kinds of software, Teams, jitsi , Zoom etc. Right before entering a meeting I like to check if my microfone is working and adjust the sound level of my microphone. Using the command
'pactl load-module module-loopback latency_msec=2000'
I can create a loopback device with a delay of 2s. This way I can perform a little soundcheck taking care I do not enter a conference blasting everyones ears to pieces. As I enter this command many times a day I decided to create a little button to my Gnome workspace.

Checkt it out at:
https://gitlab.com/raginggoblin/sound-loopback-device
or
https://extensions.gnome.org/extension/7577/sound-loopback/

Xscreensaver, GlSlideshow on Manjaro with Gnome 41

Another post about xscreensaver? You must be kidding me! Yes, because I could not find a blogpost that guided me to a satisfying setup. The official documentation did not help me either. This is how I configured it to my satisfaction.

My computer resides in the living room and while I am not using it, it displays a slideshow of all my digital photos. Many times I find myself just sitting and watching long forgotten holidays or trips we made. This is powered by Xscreensaver with GlSlideshow which picks a random photo from my collection. However, the integration with Gnome is not very good. Screensaver did not detect when a movie is playing or when I am watching Youtube. The official documentation of Xscreensaver does mention this problem but the configuration described there did not remedy my problem causing many sighs from my wife when I had to stop the screensaver 10 minutes into a movie.

I do not want to repeat the internet so please look at the official documentation first. The problem I had lies in the fact that Gnome keeps a connection to dbus not letting xscreensaver-dbus to connect (What kind of bus is this? The message buses I work with are all about subscriptions by many clients to a topic, but I might be overlooking something). In order to let xscreensaver detect a movie running, we have to kick this Gnome connection out of the way. As I understand things, the official way is by disabling it:

cp etc/xdg/autostart/org.gnome.SettingsDaemon.ScreensaverProxy.desktop \
/home/"USERNAME>/.config/autostart/org.gnome.SettingsDaemon.ScreensaverProxy.desktop

add a line Hidden=true to this file and reboot. For me this did not have any effect so I took a more radical approach:

sudo mv /usr/lib/gsd-screensaver-proxy /usr/lib/gsd-screensaver-proxy.org
sudo touch /usr/lib/gsd-screensaver-proxy

This way an empty file is executed, take that you prick! This way gsd-screensaver-proxy is not capable of snatching the one and only possible dbus connection from under xscreensavers nose and xscreensaver will detect media running as it should.

A second problem I had was that sometimes white images appeared between my photos. After cranking up the frame rate this problem disappeared.

To better suit my needs I forked xscreensaver to show the (relative) path to the photo. I replaced the slashes by a newline so you get a list of folder names. Many times I was looking at a photo wondering where it was taken. As my folder structure contains hints enough to lead me into the right direction this is finally a setup that suits me. You can find my fork at: https://github.com/raginggoblin/xscreensaver

Use Java as scripting language with a shebang and syntax highlightning

Recently I have been playing with Java as a scripting language and I must say, this could become a very nice way of scripting for me. Of course, there are always soreheads that will point out Java is too slow for this and that language X or Y is so much better suited for this task, but as I am writing Java on a daily basis, I am much quicker in writing a Java script (not a javascript!!!) than e.g. a bash script. And if you do not know Java, please keep your mouth, because you have no idea how powerful it actually is. As for startup speed of the jvm, this will become less an argument because of modularity and Graal.

Using the shebang in a Java file however will rob you of all the nice features an IDE is providing you as it has no way of knowing what the file actually represents. I therefore propose (and that is what I practice from now on) to use the file extension .jv. You can than tell your IDE that a jv file should be treated as a Java file.

shebangandcodecompletion
A .jv file treated as a java file

Breeze theme for Thunderbird

Lately I switched back to KDE as I like to switch between desktop environments from time to time. One thing that always bothered me was how awful Thunderbird sticks out when using the default KDE Breeze theme. It is a beautiful theme but Thunderbird looks horrible with its GTK-ish icons. Especially because the folder icons are taken from the system theme:

Default

Yesterday I saw a nice adjustment of the Monterail themes on Github (https://github.com/BDeliers/thunderbird-monterail) that gave me enough information to make at least the folder tree a bit more pleasing to the eye.

BreezeIcons

Thunderbird still does not fit in very well, but it looks tolerable. I have tried switching to KMail over and over again but keep coming back to Thunderbird as it is just a superior email client. And with these Breeze icons I can use it on KDE as well.

Code and usage information is on my Gitlab page: https://gitlab.com/raginggoblin/thunderbird-breeze

Move to Gitlab with a simple Java and Maven project

I recently decided to move all my code from Github to Gitlab. Moving the repositories was a breeze due to the import function of Gitlab. There is one single feature however that I am missing from Github. Gitlab does not have a proper release page. It is on the backlog (41766) of Gitlab, but I am afraid that it might take a little while before it lands into Gitlab. Gitlab provides a different mechanism to release your code using a build pipeline based on Docker and using git tags.

For a very simple Java (with Maven) project however, I found this a bit intimidating and therefore I decided to write a short introduction to get you going. This is the simplest of the simplest beginnings and only serves as a starter. But from hereon you can enhance your own pipeline and there are plenty resources on the web to get you moving on. Only this first start was somehow lacking in my opinion.

As said, the build pipeline of Gitlab is based on Docker and to get you going you will need a runner. Luckily when you are on gitlab.com this is already taken care of by a couple of shared runners, so no need to worry about this. To kickoff your pipeline add a file named

.gitlab-ci.yml

to the root of your project. The simplest form of this yaml file can be:

image: maven:3-jdk-8-alpine

maven_build:
   script: "mvn package -B"
   artifacts:
      paths:
      - target/your build jar.jar

 When you push this to Gitlab it will automatically kickoff a build for you at every commit.

A couple of things to note here. First, there is a reference to a Maven image. As the pipeline will use Docker, it will start a fresh container where Maven will not be available. So you need to tell the system to use an image that has Maven installed. You can find images at Docker hub. I just picked one with a Java 8 and a Maven 3 installation. The second thing to note is the build job I configured. The name (maven_build) does not matter, just pick one to your liking. The build command should be familiar to any Java developer, I just added the B flag so it will run without interruptions. At the end you will have to configure your artifacts. Otherwise, you will end up with artifacts only containing the sourcecode. You reference the jar which is normally available in the target directory. You can build your Maven project locally first to find out what your artifact will be named.

When you push this file you will find download buttons under CI/CD -” Jobs where you will be able to download your artifacts.

To further suit my needs I use a bit of an enhanced version of this configuration. E.g. I only build when I push a tag, otherwise I have to remove all the intermediate builds to prevent flooding the system with useless binaries. You can find an example here: MiWakeUpLight/.gitlab-ci.yml. Note that it is not possible to filter for a branch AND for a tag, the filtering is an OR filter (though a feature request exists).

For the rest everything is very well documented, but as a simple Java developer I had to adjust my workflow a bit to get me going on Gitlab.

MiWakeUpLight with WildFly Swarm

Recently I wanted to find out if WildFly Swarm is a real challenger for Spring Boot. Rather than creating another ‘Hello World’ application I decided to convert a project I use on an ‘almost’ daily basis to a WildFly Swarm application. This way I could compare the two frameworks. I created a clone of https://github.com/raginggoblin/MiWakeUpLight with WildFly Swarm instead of Spring Boot. You can find this project on https://github.com/raginggoblin/MiWakeUpLightSwarm. So there you can find a WildFly Swarm project that contains all technologies you want in a full stack application, i.e. a database (H2), JPA, Hibernate, datasources, CDI, logging, configuration with yaml, EJB, JaxRS and a AngularJs frontend on top.