Skip to content

Instantly share code, notes, and snippets.

@hexdefined
Last active September 8, 2024 15:22
Show Gist options
  • Save hexdefined/d7c0a0a9ff27e689c4d289ceacfd7c9a to your computer and use it in GitHub Desktop.
Save hexdefined/d7c0a0a9ff27e689c4d289ceacfd7c9a to your computer and use it in GitHub Desktop.
Patch JD-GUI to use a dark theme
sed -i '/<lookAndFeel>/{s/javax\.swing\.plaf\.metal\.MetalLookAndFeel/com\.bulenkov\.darcula\.DarculaLaf/}' ~/.config/jd-gui.cfg
java -Dhidpi -Dswing.aatext=true -Dawt.useSystemAAFontSettings=on -jar jd-gui-mod.jar
[ ! -f jd-gui-1.6.6.jar ] && wget https://github.com/java-decompiler/jd-gui/releases/download/v1.6.6/jd-gui-1.6.6.jar
[ ! -f darcula.jar ] && wget https://github.com/bulenkov/Darcula/raw/master/build/darcula.jar
tmp=$(mktemp -d)
cp jd-gui-1.6.6.jar darcula.jar $tmp
pushd $tmp
unzip -j jd-gui-1.6.6.jar org/fife/ui/rsyntaxtextarea/themes/dark.xml
mkdir -p rsyntaxtextarea/themes
mv dark.xml rsyntaxtextarea/themes/eclipse.xml
unzip darcula.jar 'com/*'
zip -r jd-gui-1.6.6.jar rsyntaxtextarea/themes/eclipse.xml com
rm -r rsyntaxtextarea com darcula.jar
popd
mv $tmp/jd-gui-1.6.6.jar jd-gui-mod.jar
rmdir $tmp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment