A tool that
- Has client side window decorations with native behavior (e.g., Windows Aero Snap) on Linux & Windows
- Can recognize currently playing media on Linux via MPRIS
- Was originally supposed to show synchronized lyrics of said media, but I abandoned the project before I could build this.
- Clone the repository
- Open a terminal and navigate to the repo's root folder
- On Linux, run
./run.sh. On Windows, it should be possible to simply run.\gradlew.bat run. If not, perform the steps inrun.shbut for.\gradlew.batinstead of./gradlew.- For some reason, using the
gradlew runtask on Linux leads to GTK crashing. I haven't figured out why yet.
- For some reason, using the
Note that the newest supported Java version is Java 22.
You can manually set the Java version for Gradle to use via ./gradlew run -Dorg.gradle.java.home=/path/to/java22.
A compiled JAR file should be able to be run with a newer version of Java as well, though I still recommend sticking to Java 22.
Currently, media recognition only works on Linux. There seems to be an API for this in Windows as well, though it is less straightforward. The native title bar however is also implemented for Windows.
Fetching and showing media is not implemented yet, though it should be as simple as querying an API with the current song title and artist. The API I plan to use for this is LRCLIB. This can be done easily in Kotlin using Ktor.
Since this project interacts with native libraries a lot and thus isn't particularly platform independent, it is a reasonable question to ask why I chose to use a JVM-based language. The answer is that
- I like Kotlin.
- I wanted to learn more about Kotlin.
- I wanted to learn a declarative GUI framework like Compose.
- The problem of having custom title bars with native functionality in the JVM haunts me since I was 16 (back then with Java and Swing), and I now finally have the skills to make it a reality.
I originally considered using Flutter instead, but preferred deepening my knowledge of Kotlin over learning Dart.
If I were to start another project like this, I would probably do it in Rust (because that's another language I want to learn) and GTK (because I use GNOME).