mirror of
https://github.com/dylanaraps/pywal.git
synced 2025-02-12 16:29:38 +01:00
Args: Add -o
This commit is contained in:
parent
eb1adc0e4f
commit
de9f149ce8
20
nohup.out
Normal file
20
nohup.out
Normal file
@ -0,0 +1,20 @@
|
||||
|
||||
(thunar:774): GLib-CRITICAL **: g_file_test: assertion 'filename != NULL' failed
|
||||
|
||||
(thunar:774): GLib-CRITICAL **: g_file_test: assertion 'filename != NULL' failed
|
||||
|
||||
(thunar:774): GLib-CRITICAL **: g_file_test: assertion 'filename != NULL' failed
|
||||
|
||||
(thunar:774): GLib-CRITICAL **: g_file_test: assertion 'filename != NULL' failed
|
||||
|
||||
(thunar:774): GLib-CRITICAL **: g_file_test: assertion 'filename != NULL' failed
|
||||
|
||||
(thunar:774): GLib-CRITICAL **: g_file_test: assertion 'filename != NULL' failed
|
||||
|
||||
(thunar:774): GLib-CRITICAL **: g_file_test: assertion 'filename != NULL' failed
|
||||
|
||||
(thunar:774): GLib-CRITICAL **: g_file_test: assertion 'filename != NULL' failed
|
||||
|
||||
(thunar:774): GLib-CRITICAL **: g_file_test: assertion 'filename != NULL' failed
|
||||
|
||||
(thunar:774): GLib-CRITICAL **: g_file_test: assertion 'filename != NULL' failed
|
35
wal.py
35
wal.py
@ -51,8 +51,8 @@ def get_args():
|
||||
# arg.add_argument('-n', action='store_true',
|
||||
# help='Skip setting the wallpaper.')
|
||||
|
||||
# arg.add_argument('-o', metavar='script_name',
|
||||
# help='External script to run after "wal".')
|
||||
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.')
|
||||
@ -70,19 +70,6 @@ def get_args():
|
||||
return arg.parse_args()
|
||||
|
||||
|
||||
def process_args(args):
|
||||
"""Process the arguments."""
|
||||
|
||||
# -c
|
||||
if args.c:
|
||||
shutil.rmtree(SCHEME_DIR)
|
||||
quit()
|
||||
|
||||
# -r
|
||||
if args.r:
|
||||
reload_colors(args.t)
|
||||
|
||||
|
||||
# }}}
|
||||
|
||||
|
||||
@ -395,8 +382,17 @@ def main():
|
||||
pathlib.Path(SCHEME_DIR).mkdir(parents=True, exist_ok=True)
|
||||
|
||||
args = get_args()
|
||||
process_args(args)
|
||||
|
||||
# -c
|
||||
if args.c:
|
||||
shutil.rmtree(SCHEME_DIR)
|
||||
quit()
|
||||
|
||||
# -r
|
||||
if args.r:
|
||||
reload_colors(args.t)
|
||||
|
||||
# -i
|
||||
if args.i:
|
||||
image = str(get_image(args.i))
|
||||
|
||||
@ -411,6 +407,13 @@ def main():
|
||||
export_plain(colors)
|
||||
export_xrdb(colors)
|
||||
|
||||
# -o
|
||||
if args.o:
|
||||
subprocess.Popen(["nohup", args.o],
|
||||
stdout=open('/dev/null', 'w'),
|
||||
stderr=open('/dev/null', 'w'),
|
||||
preexec_fn=os.setpgrp)
|
||||
|
||||
return 0
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user