NetExec icon indicating copy to clipboard operation
NetExec copied to clipboard

Add Support for XDG Base Directory

Open sdushantha opened this issue 11 months ago • 5 comments

Please Describe The Problem To Be Solved nxc currently unnecessarily populates the user's home directory by storing all of its files inside ~/.nxc.

Solution This can be fixed by adding support for the XDG Base Directory. By supporting this, the nxc.conf can be stored in XDG_CONFIG_HOME/nxc and the other files in their correct directories.

sdushantha avatar Feb 08 '25 19:02 sdushantha

@Marshall-Hallenbeck @NeffIsBack if you guys want this, I can work on it. Use the XDG env variables if defined, otherwise default to the current

d4ytox avatar Apr 16 '25 17:04 d4ytox

Would be neat to have imo, but first there has to be some refactoring, so that ever flag/module respects the NXC_VARS in /nxc/paths.py

NeffIsBack avatar Apr 16 '25 17:04 NeffIsBack

@NeffIsBack I could start by unifying that first - should I open a different issue for refactoring modules to use NXC_VARS? Then i'm happy to tackle this as well

d4ytox avatar Apr 16 '25 17:04 d4ytox

All good, no issue necessary. You can open up a Draft PR if you want as soon as you made progress, so it is public. But that's not required :)

NeffIsBack avatar Apr 16 '25 17:04 NeffIsBack

@NeffIsBack ok I will, and cheers for the quick replies! :)

d4ytox avatar Apr 16 '25 17:04 d4ytox

Instead of moving the .nxc folder to the XDG_CONFIG_HOME, we decided to just give the user the option to specify a different location by setting an env variable NXC_PATH which would then serve as the nxc home dir. Hopefully that is roughly what you were looking for @sdushantha

NeffIsBack avatar Jun 10 '25 12:06 NeffIsBack

@NeffIsBack Thats perfect, thank you!

sdushantha avatar Jun 10 '25 12:06 sdushantha

@NeffIsBack Thats perfect, thank you!

All cudos to @d4ytox, he did 99% of the work :)

NeffIsBack avatar Jun 10 '25 12:06 NeffIsBack