Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Theme / Style Configuration Support? (Dark Mode) #13

Closed
SocraticBliss opened this issue Mar 6, 2019 · 33 comments
Closed

Theme / Style Configuration Support? (Dark Mode) #13

SocraticBliss opened this issue Mar 6, 2019 · 33 comments

Comments

@SocraticBliss
Copy link

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?

@SocraticBliss SocraticBliss added the Type: Enhancement New feature or request label Mar 6, 2019
@ghost
Copy link

ghost commented Mar 6, 2019

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

@madushan1000
Copy link

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
  1. 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.
  2. 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.

@IvarWithoutBones
Copy link

IvarWithoutBones commented Mar 6, 2019

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

@IvarWithoutBones
Copy link

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

@SocraticBliss
Copy link
Author

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 :)

@JustasMasiulis
Copy link

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.

@IvarWithoutBones
Copy link

IvarWithoutBones commented Mar 6, 2019

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

@ghost
Copy link

ghost commented Mar 6, 2019

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

@ghost
Copy link

ghost commented Mar 7, 2019

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.

@SocraticBliss
Copy link
Author

@quosego I'm in awe, fantastic work!

@JustasMasiulis
Copy link

JustasMasiulis commented Mar 7, 2019

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.

@ghost
Copy link

ghost commented Mar 10, 2019

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'.

@SocraticBliss
Copy link
Author

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

@jonpalmisc
Copy link

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.

@elliiot
Copy link

elliiot commented Mar 16, 2019

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

@agnosticlines
Copy link

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.

@agnosticlines
Copy link

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

@osardar-zz
Copy link

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...

@agnosticlines
Copy link

@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

@osardar-zz
Copy link

osardar-zz commented Apr 10, 2019

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.

@ryanmkurtz
Copy link
Collaborator

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!

@agnosticlines
Copy link

agnosticlines commented May 11, 2019

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

@pabx06
Copy link

pabx06 commented Oct 2, 2020

take a look :
https://github.com/pabx06/buildghidra
https://github.com/pabx06/buildghidra/tags

image

@pedrib
Copy link

pedrib commented Oct 2, 2020 via email

@pabx06
Copy link

pabx06 commented Oct 31, 2020

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

@pedrib
Copy link

pedrib commented Nov 1, 2020

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!

@agnosticlines
Copy link

agnosticlines commented Jan 26, 2022

Sorry to bring this thread back but is there any plans for a native theming engine or support @ryanmkurtz.

The solutions in this repo are out of date now and require significant amounts of work to bring up to date with the new builds, and maintaining them.

For example: https://github.com/roblabla/GhiDracula-Ext by @roblabla gets a good part of the way there, but it requires using bytedude to hot patch JVM emitted code, and it only affects the “LookAndFeel” rather than the entire UI experience.

I understand it was developed in an environment where people are used to those sorts of Java GUIs and where a nice theme/UX wasn’t a primary goal, but if you look at IDEs, not many people use the default themes on IDEs or text editors and I think Ghidra is the same.

Ghidra is an excellent tool and as much as we may not want to admit it, one of the reasons people choose other programs is in part the UI/UX, I know of about 4 people who want to use Ghidra but can’t because there’s no dark theme (and I don’t count inverted mode as a dark theme)

I understand developer time is limited but imo this is an important part to get Ghidra to mass adoption, is there any way the community could sponsor this feature? I would be happy to donate to developers who would implement this, not an insignificant amount of money either, that’s how important I think this is, it’s also an accessibility issue sadly.

I totally understand a response might be “why don’t you implement it yourself” which my response is, I have, but it’s not nearly as easy to update, edit, etc than a native theme engine would be, there’s a dozen places to change various theme settings even per toolbox item, then there’s the global Java LaF which affects some components but not others, and plugins will immediately break.

I asked a few years ago and the response from @dragonmacher was “we’re looking at doing this ourselves” when I offered my patch set/plug-in, but nothing seems to have come from that, is that still the plan?

Also just to be clear I don’t mean to come off as criticising, I’m not, I’m just concerned maybe this request has gotten lost internally or maybe the value of it wasn’t understood outside of the NSA, you’ve made an amazing tool and open sourcing it is incredible, it just needs a few comfort features to be able to eclipse the bigger players such as IDA, your decompiler is already far better for most things, especially embedded.

@pedrib
Copy link

pedrib commented Jan 26, 2022

@agnosticlines my version of ghidra.hues works out of the box with the latest Ghidra:
https://github.com/pedrib/ghidra.hues

@agnosticlines
Copy link

@agnosticlines my version of ghidra.hues works out of the box with the latest Ghidra:
https://github.com/pedrib/ghidra.hues

Oh that’s super cool! I only tried the original, it still doesn’t change the toolbox themes etc, which a more cohesive first party theme manager might provide, I’m gonna check this out though, thank you!

hues is limited to just RGB colours though right? It can’t change the actual lookandfeel of specific elements?

@roblabla
Copy link
Contributor

and it only affects the “LookAndFeel” rather than the entire UI experience.

I know there's a few things ghidracula-ext doesn't stylize, but none of them are inherently impossible to do. The main one, the decompiler/disassembler view, is intentionally not styled because ghidra already has a theme system for it. I could override the defaults if the user didn't provide a theme (and it's something I've been meaning to do, but haven't found the time for yet). The biggest drawback of this approach is that it requires a bit of maintenance time to keep it working across ghidra updates, and I haven't been very good at putting that work in X).

@pedrib
Copy link

pedrib commented Jan 26, 2022

@agnosticlines my recommendation is to change the look and feel to "Metal", turn on inverted colors, then use the ghidra.hues plugin to pick the darker color. It works very well for me for years, and while IDA's dark themes are more polished, there's little practical difference for day to day usage.

The fonts on the other hand... Java font rendering is terrible, at least on Linux. That definitely needs an improvement, and it can be improved, since JetBrains IDEs render fonts very nicely in Linux.

@TheEtwolf
Copy link

Would be nice if this wasn't Windows centric.......bummer. I'll have to try and sort it on Mac OS. Still thank you for your work.

@dragonmacher
Copy link
Collaborator

dragonmacher commented Nov 17, 2022

Ghidra now includes a Theme feature.

Fixed by e657a70

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests