Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ::::::::::::::
- pomodoro
- ::::::::::::::
- #!/bin/bash
- POMS=1
- while :
- do
- if [ $((POMS%4)) == 0 ]; then
- timer -m="Take a long break" 25
- timer -m="Get back to work!" 15
- else
- timer -m="Take a short break" 25
- timer -m="Get back to work!" 5
- fi
- echo "Pomodori completed: $POMS"
- notify-send "Pomodori completed: $POMS"
- POMS=$(( POMS+1 ))
- done
- ::::::::::::::
- timer
- ::::::::::::::
- #!/bin/bash
- # Usage: timer [-m="message"] [-s] [ minutes | hours minutes seconds]
- # OPTIONS
- # -m=* Attach a message to display
- # default option values
- SOUND=1
- # check for options
- OPTIONS=1
- while [[ $OPTIONS > 0 ]]; do
- case $1 in
- -*)
- #echo "${1#-*}"
- case $1 in
- -m=*|--message=*)
- MESSAGE="${1#*=}";;
- -s|--silent)
- SOUND=0;;
- esac
- shift;;
- *)
- OPTIONS=0;;
- esac
- done
- # assign inputs to variables
- case $# in
- 1)
- h=0; m=$1; s=0;;
- 2)
- h=0; m=$1; s=$2;;
- 3)
- h=$1; m=$2; s=$3;;
- esac
- echo "Timer started at $(date)"
- sleep $(( $h * 3600 + $m * 60 + $s ))
- echo "Timer elapsed at $(date)"
- echo $MESSAGE
- #tput bel
- notify-send 'Timer' "$MESSAGE" -i /usr/share/icons/Papirus/64x64@2x/categories/preferences-desktop-notification-bell.svg
- if [ $SOUND == 1 ]; then
- paplay /home/owb/sounds/wav/Metal_Gong-Dianakc-109711828.wav &
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement