From 2e01fe55144f159add6f5e578b1b886639de4bd4 Mon Sep 17 00:00:00 2001
From: Tobias Reisinger <tobias@msrg.cc>
Date: Tue, 16 Jan 2024 03:23:54 +0100
Subject: [PATCH] Remove asciinema logging

---
 .bin/asciinema-log                       | 32 ------------------------
 .bin/menu-shutdown                       |  2 --
 .bin/user-cleaner                        | 12 ---------
 .config/env.d/99-local##hostname.portalo |  1 -
 .config/zsh/.zshrc                       |  4 ---
 5 files changed, 51 deletions(-)
 delete mode 100755 .bin/asciinema-log
 delete mode 100755 .bin/user-cleaner

diff --git a/.bin/asciinema-log b/.bin/asciinema-log
deleted file mode 100755
index 36b49d3..0000000
--- a/.bin/asciinema-log
+++ /dev/null
@@ -1,32 +0,0 @@
-#!/usr/bin/env sh
-
-set -e
-
-if [ -x "$(command -v asciinema)" ] \
-	&& [ -z "$ASCIINEMA_REC" ] \
-	&& [ -n "$ASCIINEMA_LOG" ]
-then
-	ASCIINEMA_LOG_DIR="$HOME/.cache/logs"
-	mkdir -p "$ASCIINEMA_LOG_DIR"
-	_file_name_date=$(date +%Y-%m-%d_%H%M%S)
-
-	if [ "$ASCIINEMA_LOG" = "raw" ]
-	then
-		export ASCIINEMA_LOG_FILE="$ASCIINEMA_LOG_DIR/asciinema-$_file_name_date.txt"
-		asciinema rec --quiet --raw "$ASCIINEMA_LOG_FILE"
-		exit 0 # Parent script should exit
-	fi
-	if [ "$ASCIINEMA_LOG" = "video" ]
-	then
-		export ASCIINEMA_LOG_FILE="$ASCIINEMA_LOG_DIR/asciinema-$_file_name_date.cast"
-		asciinema rec --quiet --idle-time-limit=3 -t "Terminal log on $_file_name_date" "$ASCIINEMA_LOG_FILE"
-		exit 0 # Parent script should exit
-	fi
-
-	echo "Invalid value for ASCIINEMA_LOG: $ASCIINEMA_LOG"
-	echo "Valid values are: raw, video"
-	echo "Your session will not be recorded"
-	exit 1 # Parent script should not exit
-fi
-
-exit 1 # Parent script should not exit
diff --git a/.bin/menu-shutdown b/.bin/menu-shutdown
index beb9368..2fd8ea2 100755
--- a/.bin/menu-shutdown
+++ b/.bin/menu-shutdown
@@ -16,8 +16,6 @@ if [ -z "$action" ]; then
 	exit 1
 fi
 
-notify-send "$(user-cleaner)"
-
 case "$action" in
 	backup-shutdown)	_menu_shutdown_backup && systemctl poweroff -i ;;
 	shutdown)		systemctl poweroff -i ;;
diff --git a/.bin/user-cleaner b/.bin/user-cleaner
deleted file mode 100755
index 64657c3..0000000
--- a/.bin/user-cleaner
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/usr/bin/env sh
-
-echo "Running user-cleaner..."
-
-# clean old logs
-log_dir="$HOME/.cache/logs"
-if [ -d "$log_dir" ]
-then
-	echo "Cleaning old logs..."
-	find "$log_dir" -type f -mtime +3 -print -delete
-	find "$log_dir" -type f -mtime +1 -size -25k -print -delete
-fi
diff --git a/.config/env.d/99-local##hostname.portalo b/.config/env.d/99-local##hostname.portalo
index 41a588b..087b50a 100755
--- a/.config/env.d/99-local##hostname.portalo
+++ b/.config/env.d/99-local##hostname.portalo
@@ -1,7 +1,6 @@
 #!/bin/sh
 
 export AUTOSTART_DISPLAY="Hyprland"
-export ASCIINEMA_LOG="video"
 
 export MONITOR_PRIMARY="DisplayPort-0"
 export MONITOR_SECONDARY="HDMI-A-0"
diff --git a/.config/zsh/.zshrc b/.config/zsh/.zshrc
index 07d9474..6eb940d 100644
--- a/.config/zsh/.zshrc
+++ b/.config/zsh/.zshrc
@@ -111,7 +111,3 @@ source source-remote-file \
 
 [ -x "$(command -v direnv)" ] && eval "$(direnv hook zsh)"
 [ -x "$(command -v starship)" ] && eval "$(starship init zsh)"
-
-asciinema-log && exit
-
-true # Don't start with 1 as exit code