set :timer, 25*60              # 25 minute pomodoros
set :timer_break, 5*60         # 5 minute breaks
set :warning, 5*60             # show warning color in tmux at <5 minutes, 0 to disable
set :warning_color, 'red,bold' # warning color for tmux is red/bold
set :break_color, 'magenta'    # break color is blue
set :interval, 1               # refresh timer every 1 second
set :tmux, true                # turn on tmux integration
set :tmux_theme, "#[fg=mycolor,bg=mycolor]#[fg=%s]%s#[fg=mycolor,bg=mycolor]"

# adds `-t --today` option, which opens a text file in vim
option :t, :today, 'open today sheet' do
  `vim -O ~/.thyme-today.md ~/.thyme-records.md < \`tty\` > \`tty\``
end

# adds `-s --seconds num` option, which allows on the fly timer
option :s, 'seconds num', 'run with custom seconds' do |num|
  set :timer, num.to_i
  run
end

# execute hook before thyme program starts
before(:all) do
  `notify-send 'Uruchomiłem serwer pomidora.'`
	`tmux set-option -g status-bg black`
end

# execute hook before each pomodoro
before do
  `notify-send 'Pomidor rozpoczęty'`
end

# execute hook after each pomodoro
after do |seconds_left|
  `notify-send 'Pomidor skończony' 'Zrób sobie chwilę przerwy, pooddychaj, zapal, napij sie kawy, kogoś wkurz - nie wiem, zajmij się sobą :)'` if seconds_left == 0
	`tmux new-window -n _screensaver_ "~/bin/pipes.sh  -r 0 -p 50 -t 3 -s 10; tmux set -g status on"` if seconds_left == 0 
end

# execute hook after thyme program quits
after(:all) do
  `notify-send 'Zrobiłeś pomidory' 'Pomidorek zakończony......'`

end


option :t, :today, 'open today sheet' do
  `vim ~/.thyme_today.md < \`tty\` > \`tty\``
end
