]> git.rmz.io Git - dotfiles.git/blob - awesome/widgets/pomodoro.lua
awesome: add binding to start vimwiki
[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 = 0.5 * 60
6 pomodoro.long_pause_duration = 1 * 60
7 pomodoro.work_duration = 1 * 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 () naughty.notify{ text = "start_pause", timeout = 10 } end)
23
24 globalkeys = awful.util.table.join(globalkeys,
25 awful.key({ modkey, "Shift" }, "p", function() pomodoro:start() end)
26 )
27
28 return pombox