Skip to content

Instantly share code, notes, and snippets.

@dovydasvenckus
Forked from ReekenX/pomodoro.bash
Last active February 28, 2023 10:44
Show Gist options
  • Save dovydasvenckus/eac6a231035b285e0d17e5155183ab9b to your computer and use it in GitHub Desktop.
Save dovydasvenckus/eac6a231035b285e0d17e5155183ab9b to your computer and use it in GitHub Desktop.
Pomodoro Bash
#!/bin/sh
at now + 25 minutes -f break-over.sh
#!/bin/sh
at now + 5 minutes -f break-over.sh

Readme

Instalation

TODO

Dependencies

  • mpv

Uses of other peoples work

Alarm sound from Pixabay

#!/bin/sh
nohup mpv $HOME/.local/share/pomodoro/clock-alarm.mp3 > /dev/null 2>&1 &
notify-send -i stop 'Break Over'
#!/bin/bash
# Public domain license
# Not original author: Remigijus Jarmalavičius
#
# Usage:
# pomodoro "title for work"
filename="$HOME/.pomodoro/`date '+%Y-%m-%d'`.log"
while [ 1 ]
do
counter=0
limit=25
summary="Podoro session"
startmessage="Start $1!"
endmessage="Done with $1! New session has started, interrupt to rest a bit."
notify-send -i tomato -t -1 "$summary" "$startmessage"
echo
while [ $counter != $limit ]; do
clear
echo "Working on $1"
echo
if [ -e "$filename" ]
then
echo "Today:"
echo
sort "$filename" | awk '{print $1}' | uniq -c;
fi
echo
echo "Progress:"
echo
echo -en "\t["
for i in $(seq 1 $counter)
do
echo -n "#"
done
for i in $(seq 1 $(($limit-$counter)))
do
echo -n " "
done
echo -n "] $counter/$limit"
echo
sleep 60
let "counter = $counter + 1"
done
if [ $counter = $limit ]; then
echo
notify-send -i tomato -t -1 "$summary" "$endmessage"
nohup mpv $HOME/.local/share/pomodoro/clock-alarm.mp3 > /dev/null 2>&1 &
echo $1 $2 >> "$filename"
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment