[chirp_devel] XDG-compliant patch for Linux
Dan Smith
Thu Jul 9 15:23:03 PDT 2020
> I created a simple patch to move the chirp data directory from ~/.chirp
> to the directory pointed to by $XDG_CONFIG_HOME. It uses ~/.config/chirp
> as a fallback if $XDG_CONFIG_HOME is not set.
--- a/chirp/platform.py 2020-06-25 22:08:20.101976074 -0700
+++ b/chirp/platform.py 2020-06-25 22:10:19.398639875 -0700
@@ -275,8 +275,17 @@ class UnixPlatform(Platform):
"""A platform module suitable for UNIX systems"""
def __init__(self, basepath):
if not basepath:
- basepath = os.path.abspath(os.path.join(self.default_dir(),
- ".chirp"))
+ try:
+ basepath = os.path.abspath(os.path.join(
+ os.environ["XDG_CONFIG_HOME"],
+ "chirp"
+ ))
+ except KeyError:
+ basepath = os.path.abspath(os.path.join(
+ self.default_dir(),
+ ".config",
+ "chirp"
+ ))
This should fall back to ~/.chirp for all the thousands of people that already have chirp installed so that they don't have to rebuild their preferences right? I'm not going to apply it if it causes everyone to lose their settings.
> I don't know how to use mercurial, so I've attached the patch here in
> hopes that someone might help add this to the upstream repo.
Well, it's part of our process and pretty well documented:
https://chirp.danplanet.com/projects/chirp/wiki/DevelopersProcess
--Dan
More information about the chirp_devel
mailing list