timeSampler: update sound and dialog tools
authorDan White <dan@whiteaudio.com>
Mon, 5 May 2025 19:23:56 +0000 (14:23 -0500)
committerDan White <dan@whiteaudio.com>
Mon, 5 May 2025 19:23:56 +0000 (14:23 -0500)
timeSampler

index 97643f6307049926dd48684e94de9e54e902c21f..7d87f1a519ec3a714bbcec3d8612d5b6607ea9b3 100755 (executable)
@@ -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