Hello! Today, I want to share a handy script that can enhance your experience with JOSM on MacOS by enabling a dark mode theme. Dark mode not only looks sleek but can also reduce eye strain, especially during late-night mapping sessions.
Note: This script is specifically for MacOS users.
Step 1: Download JOSM
If you haven’t already, download the latest version of josm-tested.jar here. Save it to a location on your Mac.
Step 2: Install the FlatLaf Plugin
FlatLaf is a fantastic plugin that allows you to apply dark themes to Java applications. After installing the plugin and restarting, go to the menu and select the dark theme: JOSM → Settings → Display → Look and Feel → FlatLaf Darcula
Step 3: Create and Run the Script
Now, let’s create a script that will launch JOSM with a dark theme. Open your favorite text editor and paste the following code:
shell #!/bin/zsh
java -Dapple.awt.application.appearance=NSAppearanceNameDarkAqua -Xmx7168m -jar /Users/YourUsername/Documents/josm-tested.jar
Make sure to replace YourUsername with your actual MacOS username. This script does the following:
- #!/bin/zsh: Informs your system to use the Zsh shell to execute the script.
- java -Dapple.awt.application.appearance=NSAppearanceNameDarkAqua -Xmx7168m -jar /Users/YourUsername/Documents/josm-tested.jar: Launches the Java runtime with dark mode enabled, allocates 7168MB (or 7GB) of RAM to JOSM (you can adjust this value), and specifies the path to your JOSM JAR file.
Step 4: Save and Make the Script Executable
Save this script with a .command extension, for example, josm-dark-mode.command. To make it executable, open your terminal, navigate to the directory where you saved the script, and run the following command:
shell chmod +x josm-dark-mode.command
Step 5: Execute the Script
Now, you can simply double-click josm-dark-mode.command, and JOSM will launch with a beautiful dark theme, thanks to the FlatLaf plugin and the MacOS appearance setting.
Enjoy your enhanced JOSM mapping experience with the dark mode theme. Happy mapping, and may your edits be as precise as ever!