I am a big fan of KDE applications for many everyday tasks. Since Hyprland is not a full desktop environment, you can choose which applications to install for text editing, images, viewers, file managers, etc.
When I started using Hyprland, I was installing Thunar as a file manager; then I switched to Nemo because it’s more powerful, then to Nautilus (but it doesn’t look right in Hyprland). Finally, I decided to use Dolphin since I already used several KDE applications in Hyprland.
This is the list of Arch packages I install in Hyprland
konsole (as a terminal, though I still use also Alacritty)
breeze-icons (to have nice icons in KDE application)
kvantum (for Kate color schemes)
okular (for a better PDF viewer and annotator)
kcalc (as a calculator)
dolphin (for a powerful file manager)
dolphin-plugins (e.g., for Dropbox folder overlay)
ark (for Archive management, including Dolphin context menus)
Note that some of the above applications (namely, Dolphin and Gweenview) have “baloo” (the KDE file indexer and searcher) as a dependency. In Hyprland, that’s pretty useless and since it takes some resources for indexing, it’s better to disable that for good right after installing the above packages:
1
balooctl disable
Some updates after the original post:
UPDATE (8 March): After the update to KDE Plasma 6, the name of the baloo command has changed:
1
balooctl6 disable
UPDATE (30 May): Dolphin cannot seem to open files anymore because it doesn’t see any association. Its “Open With” menu is also empty. I blogged about the solution.
Let’s look at a few features of KDE applications that I like.
Concerning Dolphin, it has several powerful features, too many to list here 😉 I mention better renaming for multiple files out of the box. This feature requires additional work for Thunar or Nemo, and I never like the final result.
Let’s see the enabling of the Dropbox plugin (see the installed “dolphin-plugins” above):
After restarting Dolphin, you’ll get the nice overlay on the “Dropbox” folder:
Another reason I like KDE applications is that they have built-in HUD (Head Up Display), that is, a global searchable menu: use the keyboard shortcut Ctrl + Alt + i and you get the menu: start typing to quickly reach the intended item (in this example, I quickly switch to a custom Konsole profile):
You may want to create or change the keybinding for the file manager, in my case it is:
1
bind=$mainMod SHIFT,Return,exec,dolphin
Moreover, you’ll have to update the “~/.config/mimeapps.list” file accordingly, that is, specify this line and replace the corresponding existing ones:
1
inode/directory=org.kde.dolphin.desktop;
Concerning theming, some applications like Kate allow you to choose the color scheme. For example, since we installed Kvantum, we can choose the color scheme in Kate with “Settings” -> “Window Color Scheme”.
Konsole has profiles that you can create and customize.
On the other hand, Dolphin has no such functionality, so we should theme all KDE/Qt applications. That’s the subject of another possible future post.
Enjoy your KDE applications on Hyprland as well! 🙂
This is probably the beginning of a series of articles about testing Maven plugins.
I’ll start with the Maven Embedder, which allows you to run an embedded Maven from a Java program. Note that we’re not simply running a locally installed Maven binary from a Java program; we run Maven taken from a Java library. So, we’re not forking any process.
Whether this is useful or not for your integration tests is your decision 😉
I like to use the Maven Embedder when using the Maven Verifier Component (described in another blog post). Since it’s not trivial to get the dependencies to run the Maven Embedder properly, I decided to write this tutorial, where I’ll show a basic Java class running the Maven Embedder and a few JUnit tests that use this Java class to build (with the embedded Maven) a test Maven project.
This is the website of the Maven Embedder and its description:
Maven embeddable component, with CLI and logging support.
Remember: this post will NOT describe integration testing for Maven plugins; however, getting to know the Maven Embedder in a simpler context was helpful for me.
Let’s create a simple Java Maven project with the quickstart archetype
Shell
1
2
3
4
5
6
7
mvn archetype:generate\
-DarchetypeGroupId=org.apache.maven.archetypes\
-DarchetypeArtifactId=maven-archetype-quickstart\
-DarchetypeVersion=1.4\
-DgroupId=com.examples\
-DartifactId=maven-embedder-example\
-DinteractiveMode=false
Let’s change the Java version in the POM to Java 17, use a more recent version of JUnit, and add another test dependency we’ll use later:
XHTML
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<properties>
...
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
</properties>
<dependencies>
<!-- Testing dependencies -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.2</version>
<scope>test</scope>
</dependency>
<!-- For the FileUtils.deleteDirectory that
we use in tests. -->
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.6</version>
<scope>test</scope>
</dependency>
...
Let’s import the Maven Java project into Eclipse (assuming you have m2e installed in Eclipse).
Let’s add the dependencies for the Maven Embedder:
Getting all the needed dependencies right for the Maven Embedder is not trivial due to the dynamic nature of Maven components and dependency injection. The requirements are properly documented above.
Let’s replace the “App.java” inside “src/main/java/” with this Java class:
Java
1
2
3
4
5
6
7
8
9
10
11
12
13
packagecom.examples;
importorg.apache.maven.cli.MavenCli;
publicclassMavenEmbedderRunner{
publicintrun(StringbaseDir,String...args){
MavenCli cli=newMavenCli();
// Required to avoid the error:
// "-Dmaven.multiModuleProjectDirectory system property is not set."
That’s just a simple example of using the Maven Embedder. We rely on its “doMain” method that takes the arguments to pass to the embedded Maven, the base directory from where we want to launch the embedded Maven, and the standard output/error where Maven will log all its information. In a more advanced scenario, we could store the logging in a file instead of the console by passing the proper “PrintStream” streams acting on files.
Let’s create the folder “src/test/resources” (it will be used by default as a source folder in Eclipse); this is where we’ll store the test Maven project to build with the Maven Embedder.
Inside that folder, let’s create another Maven project (remember, this will be used only for testing purposes: we’ll use the Maven Embedder to build that project from a JUnit test):
Shell
1
2
3
4
5
6
7
mvn archetype:generate\
-DarchetypeGroupId=org.apache.maven.archetypes\
-DarchetypeArtifactId=maven-archetype-quickstart\
-DarchetypeVersion=1.4\
-DgroupId=com.examples\
-DartifactId=maven-quickstart-example\
-DinteractiveMode=false
We rely on the fact that the contents of “src/test/resources” are automatically copied recursively into the “target/test-classes” folder. Eclipse and m2e will take care of such a copy; during the Maven build, there’s a dedicated phase (coming before the phase “test”) that performs the copy: “process-test-resources”.
Let’s replace the “AppTest.java” inside “src/test/java/” with this JUnit class:
The first test is simpler: it runs the embedded Maven with the goals “clean” and “verify” on the test project we created above. The second one is more oriented to a proper integration test since it also passes the standard system property to tell Maven to use another local repository (not the default one “~/.m2/repository”). In such a test, we use a temporary local repository inside the target folder and always wipe its contents before the test. This way, Maven will always start with an empty local repository and download everything from scratch for building the test project in this test. On the contrary, the first test, when running the embedded Maven, will use the same local repository of your user.
The first test will be faster but will add Maven artifacts to your local Maven repository. This might be bad if you run the “install” phase on the test project because the test project artifacts will be uselessly stored in your local Maven repository.
The second test will be slower since it will always download dependencies and plugins from scratch. However, it will be completely isolated, which is good for tests and makes it more reproducible.
Note that we are not running Maven on the test project stored in “src/test/reources” to avoid cluttering the test project with generated Maven artifacts: we build the test project copied in the “target/test-classes”.
In both cases, we expect success (as usual, a 0 return value means success).
In a more realistic integration test, we should also verify the presence of some generated artifacts, like the JAR and the executed tests. However, this is easier with the Maven Verifier Component, which I’ll describe in another post.
IMPORTANT: if you run these tests from Eclipse and they fail because the Embedded Maven cannot find the test project to build, run “Project -> Clean” so that Eclipse will force the copying of the test project from “src/test/resources” to “target/test-classes” directory, where the tests expect the test project. Such a copy should happen automatically, but sometimes Eclipse goes out of sync and removes the copied test resources.
If you run such tests, you’ll see the logging of the embedded Maven on the console while it builds the test project. For example, something like that (the log is actually full of additional information like the Java class of the current goal; I replaced such noise with “…” in the shown log below):
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
[main] INFO ... - Scanning for projects...
[main] INFO ... -
[main] INFO ... - ---------------< com.examples:maven-quickstart-example >----------------
[main] INFO ... - Building maven-quickstart-example 1.0-SNAPSHOT
[main] INFO ... - from pom.xml
[main] INFO ... - --------------------------------[ jar ]---------------------------------
[main] INFO ... -
[main] INFO ... - --- clean:3.1.0:clean (default-clean) @ maven-quickstart-example ---
[main] INFO ... -
[main] INFO ... - --- resources:3.0.2:resources (default-resources) @ maven-quickstart-example ---
[main] INFO ... - Using 'UTF-8' encoding to copy filtered resources.
[main] INFO ... - skip non existing resourceDirectory /Users/bettini/work/maven/maven-embedder-example/target/test-classes/maven-quickstart-example/src/main/resources
[main] INFO ... -
[main] INFO ... - --- compiler:3.8.0:compile (default-compile) @ maven-quickstart-example ---
[main] INFO ... - Changes detected - recompiling the module!
[main] INFO ... - Compiling 1 source file to /Users/bettini/work/maven/maven-embedder-example/target/test-classes/maven-quickstart-example/target/classes
[main] INFO ... -
[main] INFO ... - --- resources:3.0.2:testResources (default-testResources) @ maven-quickstart-example ---
[main] INFO ... - Using 'UTF-8' encoding to copy filtered resources.
[main] INFO ... - skip non existing resourceDirectory /Users/bettini/work/maven/maven-embedder-example/target/test-classes/maven-quickstart-example/src/test/resources
[main] INFO ... -
[main] INFO ... - --- compiler:3.8.0:testCompile (default-testCompile) @ maven-quickstart-example ---
[main] INFO org.apache.maven.plugin.compiler.TestCompilerMojo - Changes detected - recompiling the module!
[main] INFO ... - Compiling 1 source file to /Users/bettini/work/maven/maven-embedder-example/target/test-classes/maven-quickstart-example/target/test-classes
[main] INFO ... -
[main] INFO ... - --- surefire:2.22.1:test (default-test) @ maven-quickstart-example ---
[main] INFO ... -
[main] INFO ... - -------------------------------------------------------
[main] INFO ... - T E S T S
[main] INFO ... - -------------------------------------------------------
[ThreadedStreamConsumer] INFO ... - Running com.examples.AppTest
[ThreadedStreamConsumer] INFO ... - Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.013 s - in com.examples.AppTest
[main] INFO ... - --- jar:3.0.2:jar (default-jar) @ maven-quickstart-example ---
[main] INFO ... - Building jar: /Users/bettini/work/maven/maven-embedder-example/target/test-classes/maven-quickstart-example/target/maven-quickstart-example-1.0-SNAPSHOT.jar
[main] INFO ... - ------------------------------------------------------------------------
[main] INFO ... - BUILD SUCCESS
[main] INFO ... - ------------------------------------------------------------------------
[main] INFO ... - Total time: 1.340 s
[main] INFO ... - Finished at: 2024-02-14T20:32:32+01:00
[main] INFO ... - ------------------------------------------------------------------------
REMEMBER: this is not the output of the main project’s build; it is the embedded Maven running the build from our JUnit test on the test project.
Note that the two tests will build the same test project. In a more realistic integration test scenario, each test should build a different test project.
If you only run the second test after it finishes, you can inspect the “target/test-classes” to see the results of the build (note the “local-repo” containing all the downloaded dependencies and plugins for the test project and the generated artifacts, including test results, for the test project):
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
ls target/test-classes/local-repo/
backport-util-concurrent classworlds com commons-io junit org
tree target/test-classes/maven-quickstart-example/
target/test-classes/maven-quickstart-example/
├── pom.xml
├── src
│ ├── main
│ │ └── java
│ │ └── com
│ │ └── examples
│ │ └── App.java
│ └── test
│ └── java
│ └── com
│ └── examples
│ └── AppTest.java
└── target
├── classes
│ └── com
│ └── examples
│ └── App.class
├── generated-sources
│ └── annotations
├── generated-test-sources
│ └── test-annotations
├── maven-archiver
│ └── pom.properties
├── maven-quickstart-example-1.0-SNAPSHOT.jar
├── maven-status
│ └── maven-compiler-plugin
│ ├── compile
│ │ └── default-compile
│ │ ├── createdFiles.lst
│ │ └── inputFiles.lst
│ └── testCompile
│ └── default-testCompile
│ ├── createdFiles.lst
│ └── inputFiles.lst
├── surefire-reports
│ ├── 2024-02-17T10-26-50_728.dumpstream
│ ├── com.examples.AppTest.txt
│ └── TEST-com.examples.AppTest.xml
└── test-classes
└── com
└── examples
└── AppTest.class
28 directories, 14 files
Now, you can continue experimenting with the Maven Embedder.
In the next articles, we’ll see how to use the Maven Embedder when running Maven integration tests (typically, for integration tests of Maven plugins), e.g., together with the Maven Verifier Component.
The default screen locking uses a bright screen. Let’s make it darker:
1
mkdir~/.config/swaylock
And let’s create and edit its configuration file “~/.config/swaylock/config”; in this example, I’m going to make it “dark green”, so I’m specifying:
1
color=032205FF
By looking at its “man page”, we can see:
-c, –color <rrggbb[aa]>
Turn the screen into the given color instead of white. If -i is used, this sets the background of the image to the given color. Defaults to white (FFFFFF).
The “aa” in the previously present hex notation is the alpha value defining the color’s opacity. In the above example, I’m using no opacity.
This is my complete configuration file for swaylock:
1
2
3
daemonize
show-failed-attempts
color=032205FF
Again, the “man page” explains these values:
-F, –show-failed-attempts Show the current count of failed authentication attempts.
-f, –daemonize Detach from the controlling terminal after locking.
In my Hyprland configuration file, I also use “swayidle” (the Idle management daemon for Wayland)
1
2
3
4
# Screensaver and lock screen
# Swaylock configuration in ~/.config/swaylock/config
Note that I’ve used a character using the installed Nerd font. Of course, you can choose anything you like. The “wlogout” menu will appear when you click on that module.
That’s all for this post 🙂
We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. By clicking “Accept All”, you consent to the use of ALL the cookies. However, you may visit "Cookie Settings" to provide a controlled consent.
This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary cookies are absolutely essential for the website to function properly. These cookies ensure basic functionalities and security features of the website, anonymously.
Cookie
Duration
Description
cookielawinfo-checkbox-analytics
11 months
This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics".
cookielawinfo-checkbox-functional
11 months
The cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional".
cookielawinfo-checkbox-necessary
11 months
This cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary".
cookielawinfo-checkbox-others
11 months
This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other.
cookielawinfo-checkbox-performance
11 months
This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance".
viewed_cookie_policy
11 months
The cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data.
Functional cookies help to perform certain functionalities like sharing the content of the website on social media platforms, collect feedbacks, and other third-party features.
Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.
Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics the number of visitors, bounce rate, traffic source, etc.
Advertisement cookies are used to provide visitors with relevant ads and marketing campaigns. These cookies track visitors across websites and collect information to provide customized ads.