summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDylan Araps <dylan.araps@gmail.com>2017-06-19 18:19:36 +1000
committerDylan Araps <dylan.araps@gmail.com>2017-06-19 18:19:36 +1000
commitde9f149ce87fb251117879dadd2891228dfa1c9a (patch)
tree4df4a8742e8104d23d5a71ed8a0f2415b8b8d0b0
parenteb1adc0e4f4726e9a80a099f3f552e096baf353b (diff)
Args: Add -o
-rw-r--r--nohup.out20
-rwxr-xr-xwal.py35
2 files changed, 39 insertions, 16 deletions
diff --git a/nohup.out b/nohup.out
new file mode 100644
index 0000000..9a3e95c
--- /dev/null
+++ b/nohup.out
@@ -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
diff --git a/wal.py b/wal.py
index 63f9fb1..b7530cb 100755
--- a/wal.py
+++ b/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