Ghidra: Theme / Style Configuration Support? (Dark Mode)

Created on 6 Mar 2019  路  26Comments  路  Source: NationalSecurityAgency/ghidra

Is your feature request related to a problem? Please describe.

I understand that it's possible to Invert Colors to have a sort of semi-Dark Mode....

Main Window ->Edit->Tool Options->Tools->Use inverted colors

But it would be nice to have a few sets of pre-configured color schemes that we can switch back and forth between.

Describe the solution you'd like

Something along the lines of Notepad++'s Style Configurator might be nice, along with a preview of how it will look?

Enhancement

Most helpful comment

Hey, sorry to reopen this @ryanmkurtz, but I've got the Darcula patch to work on 9.2. Not sure how to proceed, is this something that can even be added/would be accepted into the program? It looks much nicer than the default theme, although I'd recommend leaving the inverted scheme in still.

I've had to patch out some of the IP checks since I don't understand the manifest format, providing I can fix those, would you like me to make a pull request? Or should I keep these in a seperate repo

Here's a screenshot (on Linux) to gague interest from the developers
2019-05-11-23:16:58

The biggest issue I'm having atm is the fact Darcula isn't supported anymore really, if anyone has any recomendations for a lookandfeel plugin that looks.. less terrible, let me know

All 26 comments

You can write an extention to do so. Checkout the JavaDocs.

Looks like you can hack it a little bit to install custom swing themes.

1) Download something like jtattoo (http://www.jtattoo.net), and copy the path.
2) Edit the <ghidra root>/support/launch.sh file and include the jar in the classpath. ex.

SUPPORT_DIR="${0%/*}"
if [ -f "${SUPPORT_DIR}/launch.properties" ]; then

    # Production Environment
    INSTALL_DIR="${SUPPORT_DIR}/.."
    CPATH="${INSTALL_DIR}/Ghidra/Framework/Utility/lib/Utility.jar:${SUPPORT_DIR}/JTattoo-1.6.11.jar"
    LS_CPATH="${SUPPORT_DIR}/LaunchSupport.jar"
    DEBUG_LOG4J="${SUPPORT_DIR}/debug.log4j.xml"
else

    # Development Environment
    INSTALL_DIR="${SUPPORT_DIR}/../../../.."
    CPATH="${INSTALL_DIR}/Ghidra/Framework/Utility/bin:${SUPPORT_DIR}/JTattoo-1.6.11.jar"
    LS_CPATH="${INSTALL_DIR}/GhidraBuild/LaunchSupport/bin"
    DEBUG_LOG4J="${INSTALL_DIR}/Ghidra/RuntimeScripts/Common/support/debug.log4j.xml"
fi

3) Include the option VMARGS=-Dswing.systemlaf=com.jtattoo.plaf.hifi.HiFiLookAndFeel in <ghidra root>/support/launch.properties. You can try setting other themes in the library too.
4) Start ghidra as usual, make sure you had set the theme as System in the tool options.
image
It's not perfect, but other themes might work better.

On Linux the GTK+ Theme option makes it semi-dark too, but not entirely
screenshot from 2019-03-06 21-38-56

In case others are curious, it seems @quosego was kind enough to create a plugin project that should help speed this process along! https://github.com/quosego/ghidra.plugin

At first I was going to go with tweaking the Nimbus Look and Feel (https://docs.oracle.com/javase/tutorial/uiswing/lookandfeel/color.html) but if there are better options I am all for them :)

Looks like this repo was deleted, at least it 404's for me

Looks like this repo was deleted, at least it 404's for me

I guess @quosego removed the project? Anyways, updated the post with another link, but in case it 404's again, you can always check the root :)

On Linux the GTK+ Theme option makes it semi-dark too, but not entirely

You can manually change the colors of some windows in Edit->Tool Options->Listing Display and Edit->Tool Options->Decompiler->Display With those modified there would be very few things that you'd be missing.

This works very well, the only problem being that not everything is customizable. For example, the function graph's background colour cannot be changed at all, and i can't seem to find a way to change the colour of the selected function in the listing display either. Looks like this now:
screenshot from 2019-03-06 23-07-23

@SocraticBliss I switched over to another title: https://github.com/quosego/Ghidorah and removed my half completed plugin development tutorial.

j3x1b81gfg
Just pushed this out. It is pretty rushed but it gives the basic idea of how to do this.

Hope this helps @SocraticBliss and anyone else looking at this.

@quosego I'm in awe, fantastic work!

This works very well, the only problem being that not everything is customizable. For example, the function graph's background colour cannot be changed at all, and i can't seem to find a way to change the colour of the selected function in the listing display either. Looks like this now:

The selection color can be tweaked in settings too. I don't remember which setting in particular controls it though. Try Edit->Tool Options->Listing Fields->Selection Colors, Edit->Tool Options->Listing Fields->Cursor Text Highlight and Edit->Tool Options->Listing Fields->Cursor.

MPeg6GJ4Zr

@SocraticBliss hate me / love me, I changed the project name due to redundancy and breaking up what I'm currently doing non-public wise. Ghidra offers alot of features. Will take some time to clean out what I currently have now once more to make it even more flush. My next task will be doing graphs and custom displays.

This should provide a general understanding for you or others:
https://github.com/quosego/ghidra.hues

You can also tweak existing settings via property key-value pairs without even having to go through settings / ui. A hint is to search around features and framework sourcecode for 'Preferences'.

No worries @quosego, I'll just remove the previous link :) Great work!

Adding support for the Darcula LAF would be awesome - open source and available here. Already used in JetBrains IDEs and Netbeans, so it will be familiar to users and it has been proven to work in large applications.

I've made a dark theme, there is a script to configure your code_browser.tcd : https://github.com/elliiot/ghidra_darknight

It'd be awesome to see the next release allow the graph background color to be changed, that's the one thing that's breaking the dark theme experience currently.

Also this is a pretty stellar piece of work: https://digmi.org/2019/03/26/ghidracula/

lso this is a pretty stellar piece of work: https://digmi.org/2019/03/26/ghidracula/

Agreed, unfortunately GHIDRACULA doesn't work with 9.0.1 due to the namespace typo [Issue #7] having been resolved. Hoping for a quick fix or GitHub repo from digmi soon...

@osardar Might be worth making a repo for it until they decide to post it? Don't want this to become another ida-toolbag scenario :P

I briefly played around with rebuilding Docking.jar recently but wasn't successful- I need to get the gradle build env setup and take another stab at it. I'll link back here if I succeed in the near future.

Ghidra's out-of-the-box "dark theme" will continue to be the inverted color scheme for the foreseeable future, but it looks like the community is providing great solutions...keep up the good work!

Hey, sorry to reopen this @ryanmkurtz, but I've got the Darcula patch to work on 9.2. Not sure how to proceed, is this something that can even be added/would be accepted into the program? It looks much nicer than the default theme, although I'd recommend leaving the inverted scheme in still.

I've had to patch out some of the IP checks since I don't understand the manifest format, providing I can fix those, would you like me to make a pull request? Or should I keep these in a seperate repo

Here's a screenshot (on Linux) to gague interest from the developers
2019-05-11-23:16:58

The biggest issue I'm having atm is the fact Darcula isn't supported anymore really, if anyone has any recomendations for a lookandfeel plugin that looks.. less terrible, let me know

Looks good, but why not make it a plug-in instead? Much easier to manage.

I dont know how to it with a plugin... many variable are Colors field with private scope...
Somme modification involves just commenting set background and setforground methods to use the dark look and feel also i like to run latest master branch master

BTW guys it seems quosego deleted his account and repo. I had a copy of his plugin, so I put it in my repositories:
https://github.com/pedrib/ghidra.hues

All credit goes to him, I haven't changed a thing!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

0x6d696368 picture 0x6d696368  路  18Comments

astrelsky picture astrelsky  路  16Comments

ghost picture ghost  路  29Comments

Piruzzolo picture Piruzzolo  路  19Comments

cattrace picture cattrace  路  20Comments