A visual meditation timer

As @arturovm pointed out, there is an inexplicable lack of decent meditation timers available in app form. I mean, how hard can it be?

I was given a Keybow 2040 programmable macropad for Christmas last year and decided to make an attempt at a “visual meditation timer”. Rather than indicate the end of the session via a sound, it gives a visual indication of the state of the timer. The code is CircuitPython and is available with documentation here:

No internet connection is needed. It can run from any USB power source and is designed to be “fail safe” in that there is an indicator that it is running so if it goes blank you know the power is out. Of course you might not notice that the time is up, but I think in a darkened room you will notice. Also exceptionally useful if you’re running a retreat and timing the meditation for other people.

Happy hacking!

J.R.

5 Likes

Kudos on the work to make the state of meditation timers better, Bhante!

Thank you for the offering, Bhante, I’ll have a look at it. That being said, I quite like Zazen meditation timer on the Play store.

Most smart phones come standard with a clock app that includes an alarm and a timer.

You can pick the alarm sound or customize it. I have a meditation bell WAV file.

I just use that when I meditate away from home.

I do my sitting meditations in the same room as my computer.

It took a long time for Linux ( at least GNOME ) to include a timer applet, so I made this BASH script to play an alarm ( wav file, meditation bell sound ) after visually displaying a countdown of the time left in the session.


#!/bin/bash

################################################################################
## 
## File:    meditationTimer
## 
## Purpose: Count down and display the number of minutes left. Play an audio
##          file when done.
## 
## Usage:   Type the name of the script followed by the minutes desired
##          Example: count down two hours
## 
##          meditationTimer 120
## 
## Setup:   1. Install the package called "sox" on your Linux system
##          2. Place the meditationTimerBell.wav file in the same directory as
##             this script.
##          3. Set the permission on both files with chmod 755 theFileName
## 
################################################################################


# Display a brief introduction to users who have not yet read the comment 
# block above.
if [[ -z $1 ]]; then
    echo "Usage: meditationTimer [NUM_MINUTES]"
    echo "Description: meditationTimer displays a countdown of [NUM_MINUTES]."
    echo "Description: and plays an audio file at the end."
    echo "Description: See the comment block/notes at the top of the file"
    echo "Description: for setup instructions."
    exit 1
fi


# Get the current directory so that the audio file placed in the same 
# directory can be found
directory=$(cd `dirname $0`; pwd)

# If minutes in whole numbers only is not supplied on the command line.
if [[ -n ${1//[0-9]/} ]]; then
    echo "Please supply a value for minutes,only minutes,and only whole numbers."
    exit
fi

# Convert the input argument of minutes into seconds to count down.
sec_rem=$(( 60 * $1 )) 

# Calculate and print the time left
while [ $sec_rem -gt 0 ]; do 
    clear 
    let sec_rem=$sec_rem-1 
    interval=$sec_rem 
    seconds=`expr $interval % 60` 
    interval=`expr $interval - $seconds` 
    minutes=`expr $interval % 3600 / 60` 
    interval=`expr $interval - $minutes` 
    hours=`expr $interval % 86400 / 3600` 

    printf "\nMeditation Timer:\n\n"
    printf "%02d:%02d:%02d" $hours $minutes $seconds    

    sleep 1
done

printf "\n\n"

# Play the audio file for the bell
play $directory/meditationTimerBell.wav



printf "\n\n"


################################################################################
##                    END OF FILE:  meditationTimer
################################################################################
1 Like