diff options
author | Anton Khirnov <anton@khirnov.net> | 2010-11-17 19:55:10 +0100 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2010-11-17 19:55:10 +0100 |
commit | 5d0ee0a4b3573cebf19f207eeaaf05b44a9aab4e (patch) | |
tree | 6b287b5b7abf831008895d5c738f86116d4783d7 | |
parent | a8b7231f6ef38fcd1db3a3cb0102d2de8d3aca32 (diff) |
random_wallpaper: create tmp dir if it doesn't exist
-rwxr-xr-x | scripts/random_wallpaper.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/scripts/random_wallpaper.py b/scripts/random_wallpaper.py index 55bb618..89105ec 100755 --- a/scripts/random_wallpaper.py +++ b/scripts/random_wallpaper.py @@ -40,6 +40,12 @@ except (OSError, IndexError, NameError): sys.stderr.write('Error getting X screen resolution, aborting.\n') sys.exit(-1) +if not os.path.isdir(os.path.expandvars('${FVWM_USERDIR}/tmp/')): + try: + os.mkdir(os.path.expandvars('${FVWM_USERDIR}/tmp/')) + except OSError: + sys.stderr.write('Can\'t create the tmp directory.') + sys.exit(-1) try: subprocess.check_call(['convert', os.path.join(d, f), '-resize', res, os.path.expandvars('${FVWM_USERDIR}/tmp/current_wall.png')]) except subprocess.CalledProcessError: |