summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDylan Araps <dylan.araps@gmail.com>2017-06-19 19:24:28 +1000
committerDylan Araps <dylan.araps@gmail.com>2017-06-19 19:24:28 +1000
commit57fed5b29cbd7b7a64c114a3751f47793ce8396c (patch)
treedb1bc542777728adeed54b5b9353387942deab98
parentb2ae26b4fb52ac72cc2e4afaa7e3e7d20c10a4cf (diff)
Args: Added -q
-rwxr-xr-xwal.py28
1 files 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)