Improve asciinema-log stuff

This commit is contained in:
Tobias Reisinger 2023-12-14 17:53:47 +01:00
parent 3bb298526b
commit c2f56a9d3f
Signed by: serguzim
GPG key ID: 13AD60C237A28DFE
3 changed files with 11 additions and 3 deletions

View file

@ -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

View file

@ -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

View file

@ -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