Remove pomodoro related files
Currently using Solanum, so these are no longer necessary
This commit is contained in:
parent
d68c5d0d0a
commit
0231e0718c
4 changed files with 0 additions and 122 deletions
Binary file not shown.
Binary file not shown.
122
bin/pomo
122
bin/pomo
|
|
@ -1,122 +0,0 @@
|
||||||
#!/usr/bin/env wish
|
|
||||||
|
|
||||||
package require sound
|
|
||||||
|
|
||||||
snack::sound beep -file "~/.local/share/pomo/beep.wav"
|
|
||||||
snack::sound chime -file "~/.local/share/pomo/chime.wav"
|
|
||||||
|
|
||||||
set appname "Tk timer"
|
|
||||||
|
|
||||||
# set timeleft {25 0}
|
|
||||||
# state can be "paused" or "running" or "stopped"
|
|
||||||
set state "stopped"
|
|
||||||
# phase can be "work" or "break"
|
|
||||||
set phase "work"
|
|
||||||
|
|
||||||
proc dec {} {
|
|
||||||
global timeleft
|
|
||||||
if {[lindex $timeleft 0] == 0 && [lindex $timeleft 1] == 0} {
|
|
||||||
return 0
|
|
||||||
} elseif {[lindex $timeleft 1] == 0} {
|
|
||||||
set timeleft [lreplace $timeleft 1 1 59]
|
|
||||||
set timeleft [lreplace $timeleft 0 0 [expr [lindex $timeleft 0] - 1]]
|
|
||||||
} else {
|
|
||||||
set timeleft [lreplace $timeleft 1 1 [expr [lindex $timeleft 1] - 1]]
|
|
||||||
}
|
|
||||||
return 1
|
|
||||||
}
|
|
||||||
|
|
||||||
proc notify {} {
|
|
||||||
variable msg
|
|
||||||
global phase
|
|
||||||
global appname
|
|
||||||
if {$phase == "work"} {
|
|
||||||
set msg "Break time: Remember to stretch"
|
|
||||||
} else {
|
|
||||||
set msg "Are you ready to get back to work?"
|
|
||||||
}
|
|
||||||
chime play
|
|
||||||
exec notify-send $appname $msg
|
|
||||||
}
|
|
||||||
|
|
||||||
proc setuptime {} {
|
|
||||||
global phase
|
|
||||||
global timeleft
|
|
||||||
if {$phase == "work"} {
|
|
||||||
set timeleft {25 0}
|
|
||||||
} else {
|
|
||||||
set timeleft {5 0}
|
|
||||||
}
|
|
||||||
.display configure -text [format "%02d:%02d" [lindex $timeleft 0] [lindex $timeleft 1]]
|
|
||||||
}
|
|
||||||
|
|
||||||
font create bigText -family Helvetica -size 72
|
|
||||||
font create buttonText -family Helvetica -size 30
|
|
||||||
|
|
||||||
# play/pause button
|
|
||||||
button .pp -background blue -font buttonText -text "Play" -command playpause
|
|
||||||
button .skip -font buttonText -text "Skip" -command skip
|
|
||||||
label .display -font bigText
|
|
||||||
|
|
||||||
proc next-phase {} {
|
|
||||||
global phase
|
|
||||||
global state
|
|
||||||
notify
|
|
||||||
set state "stopped"
|
|
||||||
.pp configure -text "Play"
|
|
||||||
if {$phase == "work"} {
|
|
||||||
set phase "break"
|
|
||||||
} else {
|
|
||||||
set phase "work"
|
|
||||||
}
|
|
||||||
setuptime
|
|
||||||
}
|
|
||||||
|
|
||||||
proc countdown {} {
|
|
||||||
global state
|
|
||||||
global result
|
|
||||||
global timeleft
|
|
||||||
if {$state == "running"} {
|
|
||||||
set result [dec]
|
|
||||||
if {!$result} {
|
|
||||||
next-phase
|
|
||||||
} else {
|
|
||||||
.display configure -text [format "%02d:%02d" [lindex $timeleft 0] [lindex $timeleft 1]]
|
|
||||||
after 1000 countdown
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
proc playpause {} {
|
|
||||||
global phase
|
|
||||||
global state
|
|
||||||
variable txt
|
|
||||||
if {$state == "running"} {
|
|
||||||
set state "paused"
|
|
||||||
set txt "Play"
|
|
||||||
} else {
|
|
||||||
if {$state == "stopped"} {
|
|
||||||
beep play
|
|
||||||
}
|
|
||||||
set state "running"
|
|
||||||
set txt "Pause"
|
|
||||||
countdown
|
|
||||||
}
|
|
||||||
.pp configure -text $txt
|
|
||||||
}
|
|
||||||
|
|
||||||
proc skip {} {
|
|
||||||
after cancel countdown
|
|
||||||
next-phase
|
|
||||||
}
|
|
||||||
|
|
||||||
grid rowconfigure . 0 -weight 1
|
|
||||||
grid rowconfigure . 3 -weight 1
|
|
||||||
grid columnconfigure . 0 -weight 1
|
|
||||||
grid columnconfigure . 3 -weight 1
|
|
||||||
|
|
||||||
grid .display -column 1 -columnspan 2 -row 1
|
|
||||||
grid .pp -column 1 -row 2
|
|
||||||
grid .skip -column 2 -row 2
|
|
||||||
|
|
||||||
setuptime
|
|
||||||
BIN
bin/pomodoro
BIN
bin/pomodoro
Binary file not shown.
Loading…
Add table
Reference in a new issue