From f2a5128af490651e2a35a8df97bb2cdb804c4889 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre-Alb=C3=A9ric=20Trouplin?= Date: Thu, 7 Nov 2019 09:47:23 +0100 Subject: [PATCH] feat: xdg compliant (~/.local/share) --- bm.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bm.py b/bm.py index 151aa16..ac385db 100755 --- a/bm.py +++ b/bm.py @@ -525,8 +525,10 @@ def main(): global debug debug = lambda *x,**kx: print("[debug]", *x, file=sys.stderr, **kx) - db = Database(args.get("--database", - os.path.expanduser("~/.config/bm/bookmarks.sqlite"))) + db = Database(os.path.expanduser(args["--database"] or + os.getenv('XDG_DATA_HOME', + default='~/.local/share') + + "/bm/bookmarks.sqlite")) if args["add"]: db.add(args["URL"][0], args["TAG"])