Col-E / Recaf

The modern Java bytecode editor
https://recaf.coley.software
MIT License
6.02k stars 464 forks source link

".recaf" Configuration directory #104

Closed pedroflor closed 5 years ago

pedroflor commented 5 years ago

Hi Col-E, I'm not trying to be an spammer... I just love your software and I'm trying to give some suggestions.

".recaf" Configuration directory

all the config files (.json) and others, should have their own configuration directory; for example: ".recaf" (dot recaf)

Currently, the "current" directory of "recaf-x.jar" creates a bunch of .json configuration files, generating some "visual noise".

Thanks!

andylizi commented 5 years ago

Currently, the "current" directory of "recaf-x.jar" creates a bunch of .json configuration files, generating some "visual noise".

Agreed. But instead of moving all of them to a new directory, why not just combine them to a single JSON file? It can archive the same "visual" result with a much cleaner design.

Col-E commented 5 years ago

Hi Col-E, I'm not trying to be an spammer

Nonsense, I appreciate all the issues and ideas people provide. I'm glad you like the tool enough to contribute ideas.

As for the issue of making a folder vs combining the files I will probably go with a folder. Here's the pros that I see for each:

pro: config folder

pro: single config file

So in my mind the real question is where should the folder go? The home directory? Adjacent to the recaf jar?

pedroflor commented 5 years ago

So in my mind the real question is where should the folder go? The home directory? Adjacent to the recaf jar?

In my humble opinion, within the "home" directory it's more standard and practical, but needs a little more code :)

Windows OS: C:\Users\UserName\AppData\Local\recaf GNU/Linux: /home/UserName/.config/recaf

Sample code: String currentUserHomeDirectory = System.getProperty("user.home"); // If Linux String ConfigDir = currentUserHomeDirectory + File.separator + ".config" + File.separator + ".recaf";

// If Windows String ConfigDir = currentUserHomeDirectory + File.separator + "AppData" + File.separator + "Local" + File.separator + "recaf";

Another simpler option, it's to have and adjacent directory.

Col-E commented 5 years ago

Placed the folder adjacent to the jar.

Moving the config files to rc-config/*.json is all that is needed. I decided against putting it in the home directory since its easier to find the files if they're adjacent. Plus then there is no question of write permissions.

pedroflor commented 5 years ago

Thanks!