better log handling

This commit is contained in:
zerf58 2025-06-13 16:25:23 -07:00
parent ad9315f166
commit 3a60983070
3 changed files with 5 additions and 619 deletions

View file

@ -5,26 +5,19 @@ button=$1
debug(){
debug=$ROOT/debug
# todo:
# this keeps the log file at 30 lines but breaks the pipe when doing "tail -F debug"
tail -n 30 $debug > debug.tmp && mv debug.tmp $debug
echo $1
echo $1>>$debug
}
# debugging
#tail -n 30 "$debug" > tmp && cp tmp "$debug"
active=$(bash $ROOT/get_active_window.sh)
debug ""
debug "$(date +%s)"
debug "active: $active"
debug "button: $button"
# source the app folder
#APPS="$(pwd)/apps"
#if [ -d "$APPS" ]; then
# for file in "$APPS"/*; do
# if [ -f "$file" ]; then
# . "$file"
# fi
# done
#fi
. $ROOT/find_or_open.sh
. $ROOT/apps/default_commands.sh
if [ -f "$ROOT/apps/${active%%_*}.sh" ]; then