From 6c1720d2e73f7d32793b036e47a02b6b6fa00ac8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakobus=20Sch=C3=BCrz?= Date: Tue, 11 Feb 2020 17:56:42 +0100 Subject: [PATCH] add modify user-dirs.dirs --- workdirfs.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/workdirfs.py b/workdirfs.py index d5ede4e..3521445 100755 --- a/workdirfs.py +++ b/workdirfs.py @@ -177,12 +177,22 @@ def check_dir(path, cleanup=False): def main(root, mountpoint): #FUSE(Passthrough(root), mountpoint, nothreads=True, foreground=True) check_dir(mountpoint) + with fileinput.input(os.environ['HOME']+'/.config/user-dirs.dirs.test', + inplace=True) as fh: + for line in fh: + if line.startswith('XDG_WORK_DIR'): + print("XDG_WORK_DIR=$HOME/"+mountpoint, end='') + break + else: + print("XDG_WORK_DIR=$HOME/"+mountpoint, end='') + + FUSE(Passthrough(root), mountpoint, nothreads=True, foreground=True) if __name__ == '__main__': #main(sys.argv[2], sys.argv[1]) root = os.environ['HOME']+'/archive' - mountpoint = os.environ['HOME']+'/WorkNew' + mountpoint = os.environ['HOME']+'/Work' print(len(sys.argv)) print(sys.argv) if len(sys.argv) == 1: