From 57fed5b29cbd7b7a64c114a3751f47793ce8396c Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Mon, 19 Jun 2017 19:24:28 +1000 Subject: [PATCH] Args: Added -q --- wal.py | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/wal.py b/wal.py index 4e66dcd..01fa729 100755 --- a/wal.py +++ b/wal.py @@ -4,13 +4,14 @@ wal - Generate and change colorschemes on the fly. Created by Dylan Araps """ import argparse -import re -import random import glob -import shutil -import subprocess import os import pathlib +import random +import re +import shutil +import subprocess +import sys # wal files. @@ -34,16 +35,9 @@ def get_args(): arg = argparse.ArgumentParser(description=description) # Add the args. - # arg.add_argument('-a', metavar='0-100', type=int, - # help='Set terminal background transparency. \ - # *Only works in URxvt*') - arg.add_argument('-c', action='store_true', help='Delete all cached colorschemes.') - # arg.add_argument('-f', metavar='"/path/to/colors"', - # help='Load colors directly from a colorscheme file.') - arg.add_argument('-i', metavar='"/path/to/img.jpg"', help='Which image or directory to use.') @@ -53,8 +47,8 @@ def get_args(): arg.add_argument('-o', metavar='"script_name"', help='External script to run after "wal".') - # arg.add_argument('-q', action='store_true', - # help='Quiet mode, don\'t print anything.') + arg.add_argument('-q', action='store_true', + help='Quiet mode, don\'t print anything.') arg.add_argument('-r', action='store_true', help='Reload current colorscheme.') @@ -63,9 +57,6 @@ def get_args(): help='Fix artifacts in VTE Terminals. \ (Termite, xfce4-terminal)') - # arg.add_argument('-x', action='store_true', - # help='Use extended 16-color palette.') - return arg.parse_args() @@ -382,6 +373,11 @@ def main(): # Get the args. args = get_args() + # -q + if args.q: + sys.stdout = open('/dev/null', 'w') + sys.stderr = open('/dev/null', 'w') + # -c if args.c: shutil.rmtree(SCHEME_DIR)