X-Git-Url: https://git.phdru.name/?a=blobdiff_plain;f=xsetbg.py;h=d9472bcc0b032d66fa52da1d5cab499df6c51edd;hb=a43dfc879bacb5eaae7cc7644983623c58efe02a;hp=ee9c5f883cdbc521f39d20dc9785b3d8048a361a;hpb=af555a9a090980083a3d5d283858c375df2e82c3;p=xsetbg.git diff --git a/xsetbg.py b/xsetbg.py index ee9c5f8..d9472bc 100755 --- a/xsetbg.py +++ b/xsetbg.py @@ -153,7 +153,8 @@ if not images: def change(force=False): # Use the program's file as the lock file: # lock it to prevent two processes run in parallel. - lock_file = open("xsetbg.py", 'r') + lock_file = open(os.path.join(xsetbg_dir, 'xsetbg.py'), 'r') + try: flock(lock_file, LOCK_EX|LOCK_NB) except IOError: # already locked