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