From c2f56a9d3f69ee0ae7f8b1fe470983c6064f74a4 Mon Sep 17 00:00:00 2001 From: Tobias Reisinger Date: Thu, 14 Dec 2023 17:53:47 +0100 Subject: [PATCH] Improve asciinema-log stuff --- .bin/asciinema-log | 2 +- .bin/user-cleaner | 10 ++++++++-- .config/zsh/.zshrc | 2 ++ 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.bin/asciinema-log b/.bin/asciinema-log index 941c073..36b49d3 100755 --- a/.bin/asciinema-log +++ b/.bin/asciinema-log @@ -19,7 +19,7 @@ then if [ "$ASCIINEMA_LOG" = "video" ] then export ASCIINEMA_LOG_FILE="$ASCIINEMA_LOG_DIR/asciinema-$_file_name_date.cast" - asciinema rec --quiet --idle-time-limit=3 "$ASCIINEMA_LOG_FILE" + asciinema rec --quiet --idle-time-limit=3 -t "Terminal log on $_file_name_date" "$ASCIINEMA_LOG_FILE" exit 0 # Parent script should exit fi diff --git a/.bin/user-cleaner b/.bin/user-cleaner index 38d35ca..856aa41 100755 --- a/.bin/user-cleaner +++ b/.bin/user-cleaner @@ -1,6 +1,12 @@ #!/usr/bin/env sh +echo "Running user-cleaner..." + # clean old logs log_dir="$HOME/.cache/logs" -[ -d "$log_dir" ] \ - && find "$log_dir" -type f -mtime +7 -delete +if [ -d "$log_dir" ] +then + echo "Cleaning old logs..." + find "$log_dir" -type f -mtime +7 -delete + find "$log_dir" -type f -mtime +1 -size -25k -delete +fi diff --git a/.config/zsh/.zshrc b/.config/zsh/.zshrc index 33f3e63..f2c6bd7 100644 --- a/.config/zsh/.zshrc +++ b/.config/zsh/.zshrc @@ -124,3 +124,5 @@ source source-remote-file \ [ -x "$(command -v starship)" ] && eval "$(starship init zsh)" asciinema-log && exit + +true # Don't start with 1 as exit code