summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDylan Araps <dylan.araps@gmail.com>2017-06-21 23:07:21 +1000
committerDylan Araps <dylan.araps@gmail.com>2017-06-21 23:07:21 +1000
commit7f78e529658299eeda830c1341dfbce6f5b726d9 (patch)
tree259e95bdf27a4b4416c98e76888b6927873c639a
parent5efd215969878fc7e11135b7ebefb47b8681c092 (diff)
Cleanup: Move all arg processing to process_args()
-rwxr-xr-xwal26
1 files changed, 11 insertions, 15 deletions
diff --git a/wal b/wal
index 06ebb3d..faeb672 100755
--- a/wal
+++ b/wal
@@ -100,7 +100,16 @@ def process_args(args):
if not args.n:
set_wallpaper(image)
- return colors
+ # Set the colors.
+ send_sequences(colors, args.t)
+ export_colors(colors)
+
+ # -o
+ if args.o:
+ subprocess.Popen(["nohup", args.o],
+ stdout=open("/dev/null", "w"),
+ stderr=open("/dev/null", "w"),
+ preexec_fn=os.setpgrp)
# }}}
@@ -539,21 +548,8 @@ def hex_to_rgb(color):
def main():
"""Main script function."""
create_cache_dir()
-
- # Get the args.
args = get_args()
- colors = process_args(args)
-
- # Set the colors.
- send_sequences(colors, args.t)
- export_colors(colors)
-
- # -o
- if args.o:
- subprocess.Popen(["nohup", args.o],
- stdout=open("/dev/null", "w"),
- stderr=open("/dev/null", "w"),
- preexec_fn=os.setpgrp)
+ process_args(args)
# This saves 10ms.
# pylint: disable=W0212