aboutsummaryrefslogtreecommitdiff
path: root/scripts/.scripts/pomodoro.sh
diff options
context:
space:
mode:
authorOmar Magdy <omar.professional8777@gmail.com>2022-05-01 20:27:15 +0200
committerOmar Magdy <omar.professional8777@gmail.com>2022-05-01 20:27:15 +0200
commit8248b2e9c754649523ee0b08b530edd8eb42f8f3 (patch)
treee770ce2d28f35d1e7ac28d5f238d613e81bfff27 /scripts/.scripts/pomodoro.sh
parentb89824e5a2f41c3acf49ca6b5c08bd7e71a311e7 (diff)
downloaddotfiles-8248b2e9c754649523ee0b08b530edd8eb42f8f3.tar.xz
dotfiles-8248b2e9c754649523ee0b08b530edd8eb42f8f3.zip
Added kitty/alacrity/scripts/zsh dotfiles
Diffstat (limited to 'scripts/.scripts/pomodoro.sh')
-rwxr-xr-xscripts/.scripts/pomodoro.sh46
1 files changed, 46 insertions, 0 deletions
diff --git a/scripts/.scripts/pomodoro.sh b/scripts/.scripts/pomodoro.sh
new file mode 100755
index 0000000..b8878ec
--- /dev/null
+++ b/scripts/.scripts/pomodoro.sh
@@ -0,0 +1,46 @@
+#!/bin/sh
+
+
+# To-DO
+# (1) Make it store sessions for everyday in a file and group a year in a folder and months in sub folders and the days in the months folder
+# (2) Add sound to the notifcations
+# (3) Add pause and start cabability
+# (4) Make it so that you can specify a task for each sessions
+# (5) Come up with better messeages for the notifcations
+# (6) Add something like pomo -status which displayes the timer of that session(Would be really useful to add to the bar in WMs)
+
+# stop_watch() {
+# MINUTES=$1
+# SECS=$(($MINUTES*60))
+# S=60
+# while [[ $SECS != 0 ]]
+# do
+# # sleep 1
+# SECS=$((SECS-1))
+# S=$((S-1))
+# if [[ $(($SECS%60)) == 0 ]];
+# then
+# MINUTES=$((MINUTES-1))
+# S=59
+# fi
+# [[ $S -le 9 ]] && echo $MINUTES:0$S || echo $MINUTES:$S
+# done
+# }
+
+stopwatch() {
+ seconds=$(($1*60))
+ date1=$((`date +%s` + $seconds))
+ while [ "$date1" -ge `date +%s` ];
+ do
+ echo -ne "$(date -u --date @$(($date1 - `date +%s` )) +%H:%M:%S)\r";
+ done
+}
+
+toggle_watch=true
+DURATION=$1
+TIME_IN_SECONDS=$(($DURATION*60))
+START=$(date | awk '{print $4}' | sed 's/^0//')
+notify-send -i ~/Downloads/tomato_1f345.png -t 3000 "POMODORO" "Timer started at $START"
+(sleep $TIME_IN_SECONDS && notify-send -i ~/Downloads/tomato_1f345.png -t 9999999 "POMODORO" "Take a break you desrve it.") & disown
+stopwatch $DURATION
+