From 3bd9b9920f974ff8e79269522be4c57c465dc144 Mon Sep 17 00:00:00 2001 From: Dan White Date: Mon, 5 May 2025 14:23:56 -0500 Subject: [PATCH] timeSampler: update sound and dialog tools --- timeSampler | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/timeSampler b/timeSampler index 97643f6..7d87f1a 100755 --- a/timeSampler +++ b/timeSampler @@ -30,8 +30,8 @@ # works as long as the last component isn't a symlink THISDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )" -BEEP="aplay $THISDIR/pop.wav" -#BEEP="play $THISDIR/pop.wav gain -10" +#BEEP="aplay $THISDIR/pop.wav" +BEEP="play $THISDIR/pop.wav gain -10" # the delay time between playing the sound and showing the window @@ -110,11 +110,13 @@ function lastActivity { function sampleTask { DATE=$(date +"%F %R") DATE3339=$(date +"%FT%R%:z") - ACTIVITY=$(zenity --entry \ - --title="Task sample" \ - --text="Current activity: $DATE" \ - --entry-text="$(lastActivity)") + #ACTIVITY=$(zenity --entry \ + #--title="Task sample" \ + #--text="Current activity: $DATE" \ + #--entry-text="$(lastActivity)") + ACTIVITY=$(kdialog --title="Task sample" --inputbox \ + "Current activity: $DATE" "$(lastActivity)") # ACTIVITY=`gxmessage -entry \ # -center \ # -buttons "GTK_STOCK_OK:0" \ @@ -204,11 +206,13 @@ while true; do # away, last number is a fudge factor to ensure we wakeup early enough sleeptime=$(($MINUTES*60 - 5)) # using bg + wait allows us to catch signals while waiting + echo "sleeping for: $sleeptime" sleep $sleeptime & wait $! # New way: stop, then send myself a (future) continue at an exact MINUTES # boundary + echo "kill -CONT $thispid | at now + $(nexttime) minutes " echo "kill -CONT $thispid" | at now + $(nexttime) minutes > /dev/null 2>&1 #stop myself, will resume when above "at" command fires -- 2.25.1