diff options
author | Anton Khirnov <anton@khirnov.net> | 2012-08-13 13:05:34 +0200 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2012-08-19 08:39:04 +0200 |
commit | 09e2ffa33f135754dd110983e04eac402d01293a (patch) | |
tree | a5973ad23b29df5d2dea955126329d247e70307a /scripts | |
parent | 88fbc9b4a2b68556e3dec33afdc98edd6273cf51 (diff) |
Use InfoStore instead of polluting the environment.
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/midclick_menu.sh | 4 | ||||
-rwxr-xr-x | scripts/random_wallpaper.py | 10 |
2 files changed, 8 insertions, 6 deletions
diff --git a/scripts/midclick_menu.sh b/scripts/midclick_menu.sh index 90fa578..8af6a48 100755 --- a/scripts/midclick_menu.sh +++ b/scripts/midclick_menu.sh @@ -1,6 +1,8 @@ #!/bin/bash #i=$(cat ${FVWM_USERDIR}/config-options/desktop_size) -i=1x$[fvwm_config_num_pages] +num_pages=$1 +shift 1 +i=1x${num_pages} j=${i} i=${i%x*} diff --git a/scripts/random_wallpaper.py b/scripts/random_wallpaper.py index fa9fd5d..aed95bd 100755 --- a/scripts/random_wallpaper.py +++ b/scripts/random_wallpaper.py @@ -8,11 +8,11 @@ import os.path import sys import random -if not 'WALLPAPERDIR' in os.environ: - sys.stderr.write('WALLPAPERDIR variable not set, using default value.\n') - d = os.path.expandvars('${HOME}/${FVWM_USERDIR}/images') -else: - d = os.path.expandvars('${WALLPAPERDIR}') +if len(sys.argv) < 2: + sys.stderr.write('Usage: %s <wallpaper_dir>\n'%(sys.argv[0])) + sys.exit(-1) + +d = os.path.expandvars(sys.argv[1]) sys.stderr.write('Trying directory %s.\n'%d) if not os.path.isdir(d): |