commit: 88d4c854782b15cb0553cf54c1e0634b8c1b179b
parent: 7f9b394e4cdf899c1b2407611ef9df5372e9bd37
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date: Tue, 24 Mar 2020 16:00:06 +0100
bin/wl-run: base log file name on uptime
Diffstat:
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/.local/bin/wl-run b/.local/bin/wl-run
@@ -10,5 +10,8 @@ export MY_LOCKER=swaylock
[ -z "$*" ] && ( echo "$0"': Nothing to execute, exiting…' 1>&2; exit 0 )
name="$(sed 's/[^a-z]//g' <<<$1)"
+uptime="$(cut -d' ' -f1 /proc/uptime)"
-"$@" >"${XDG_RUNTIME_DIR}"'/wl-run_'"$name"'_'"$$"'.log' 2>&1
+echo 'wl-run_'"$uptime"'_'"$name"'.log' >&2
+
+"$@" 2>&1 | tee "${XDG_RUNTIME_DIR}"'/wl-run_'"$uptime"'_'"$name"'.log' 2>&1