From a16a15e7a2412aae4e657d629c16632f2480a785 Mon Sep 17 00:00:00 2001 From: emma Date: Mon, 3 Apr 2023 13:32:49 -0400 Subject: [PATCH] fixed logging --- startsway | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/startsway b/startsway index 5d07c11..ed59a0e 100755 --- a/startsway +++ b/startsway @@ -11,7 +11,7 @@ set -e # check if $LOG_DIR is set, if it isn’t, provide a default if test -z "$LOG_DIR"; then - LOG_DIR="$HOME/.var/log" + LOG_DIR="$HOME/.var/log/sway" fi # create log directory @@ -24,8 +24,8 @@ mv "$LOG_DIR/sway.log" "$LOG_DIR/sway.log.latest" date '+%Y-%m-%dT%T %Z' >"$LOG_DIR/sway.log" # count the number of previous log files -count=1 -for file in "$LOG_DIR/sway.log.*"; do +count=0 +for file in "$LOG_DIR"/sway.log.*; do count="$(printf "%s+1\n" "$count" | bc)" done