]> git.rmz.io Git - dotfiles.git/blob - awesome/widgets/pomodoro.lua
3947aed71068ca7edfec32302b8a054a72f8c27d
[dotfiles.git] / awesome / widgets / pomodoro.lua
1 local pomodoro = require("widgets/pomodoro/init")
2 local wibox = require("wibox")
3
4 -- durations in seconds
5 pomodoro.short_pause_duration = 5 * 60
6 pomodoro.long_pause_duration = 30 * 60
7 pomodoro.work_duration = 25 * 60
8
9 -- format string
10 pomodoro.format = function (t) return " <b>"..t.."</b>" end
11
12 pomodoro.init()
13
14 pombox = wibox.layout.fixed.horizontal()
15 pombox:add(pomodoro.icon_widget)
16 pombox:add(pomodoro.widget)
17
18 --TODO connect signals to something sensible (sb:20170130)
19 -- pomodoro:connect_signal("stop_working", function () naughty.notify{ text = "stop_working", timeout = 10 } end)
20 -- pomodoro:connect_signal("stop_pause", function () naughty.notify{ text = "stop_pause", timeout = 10 } end)
21 -- pomodoro:connect_signal("start_working", function () naughty.notify{ text = "start_working", timeout = 10 } end)
22 pomodoro:connect_signal("start_pause", function ()
23 awful.spawn(terminal.." -name diary -e vim -c 'call vimwiki#diary#make_note(v:count1)' + -c 'r !date +\" * \\%H:\\%M \"' -c 'start!'")
24 end)
25
26 globalkeys = awful.util.table.join(globalkeys,
27 awful.key({ modkey, "Shift" }, "p", function() pomodoro:start() end)
28 )
29
30 return pombox