- parser = OptionParser(version="%prog " + VERSION,
- description = "Cycles through random background images.",
- usage =
- "\n(server) %prog [options] dir [dir2 ...]"
- "\n(client) %prog [options] [next|prev|rescan|reload|pause] [...]"
- "\nThe first instance to be run will be the server.\n"
- )
- parser.add_option("-p", "--permanent",
- action="store_true", dest="permanent", default=False,
- help="Make the background permanent. Note: This will cause all machines logged in with this account to simultaneously change background [Default: %default]")
- parser.add_option("-v", '-d', "--verbose", "--debug",
- action="count", dest="verbose", default=0,
- help="Make the louder (good for debugging, or those who are curious)")
- parser.add_option("-b", "--background-colour",
- action="store", type="string", dest="background_colour", default="black",
- help="Change the default background colour that is displayed if the image is not in the correct aspect ratio [Default: %default]")
- parser.add_option("--all-random",
- action="store_true", dest="all_random", default=False,
- help="Make sure that all images have been displayed before repeating an image")
- parser.add_option("-1", "--oneshot",
- action="store_true", dest="oneshot", default=False,
- help="Set one random image and terminate immediately.")
- parser.add_option("--folder-random",
- action="store_true", dest="folder_random", default=False,
- help="Give each folder an equal chance of having an image selected from it")
- parser.add_option("--convert",
- action="store_true", dest="convert", default=False,
- help="Do conversions using ImageMagick or PIL, don't rely on the window manager")
- parser.add_option("--cycle-time",
- action="store", type="int", default=1800, dest="cycle_time",
- help="Cause the image to cycle every X seconds")
- parser.add_option("--socket",
- action="store", type="string", dest="socket_filename", default=os.path.expanduser('~/.randombg_socket'),
- help="Location of the command/control socket.")
- parser.add_option("--history-file",
- action="store", type="string", dest="history_filename", default=os.path.expanduser('~/.randombg_historyfile'),
- help="Stores the location of the last image to be loaded.")
- return parser
+ parser = OptionParser(
+ description = "Cycles through random background images.",
+ usage =
+ "\n(server) %prog [options] dir [dir2 ...]"
+ "\n(client) %prog [options] [next|prev|rescan|reload|pause] [...]"
+ "\nThe first instance to be run will be the server.\n"
+ )
+ parser.add_option("-v", '-d', "--verbose", "--debug",
+ action="count", dest="verbose", default=0,
+ help="Make the louder (good for debugging, or those who are curious)")
+ parser.add_option("-b", "--background-colour",
+ action="store", type="string", dest="background_colour", default="black",
+ help="Change the default background colour that is displayed if the image is not in the correct aspect ratio [Default: %default]")
+ parser.add_option("--all-random",
+ action="store_true", dest="all_random", default=False,
+ help="Make sure that all images have been displayed before repeating an image")
+ parser.add_option("-1", "--oneshot",
+ action="store_true", dest="oneshot", default=False,
+ help="Set one random image and terminate immediately.")
+ parser.add_option("--folder-random",
+ action="store_true", dest="folder_random", default=False,
+ help="Give each folder an equal chance of having an image selected from it")
+ parser.add_option("--convert",
+ action="store_true", dest="convert", default=False,
+ help="Do conversions using ImageMagick or PIL, don't rely on the window manager")
+ parser.add_option("--cycle-time",
+ action="store", type="int", default=1800, dest="cycle_time",
+ help="Cause the image to cycle every X seconds")
+ parser.add_option("--socket",
+ action="store", type="string", dest="socket_filename", default=os.path.expanduser('~/.randombg_socket'),
+ help="Location of the command/control socket.")
+ parser.add_option("--cache-file",
+ action="store", type="string", dest="cache_filename", default=os.path.expanduser('~/.randombg_cache'),
+ help="Stores the location of the last image to be loaded.")
+ parser.add_option("--server",
+ action="store_true", dest="server", default=False,
+ help="Run in server mode to listen for clients.")
+ return parser