The basic idea is to at start (with for instance a keybinding)
- hide clutter (widgets/wibox)
- show a very out-of-our-way and subtle indication of elapsed and left time
and at stop
- bring back user to the real world
Awmodoro is in itself a very simple timer (with a progress bar ui) specifically made with regards to the Pomodoro Technique. It can be used as a regular widget, however - awmodoro provides the user with hooks allowing lua-code to be executed at start and end of each session. This allows for setup and teardown of distraction free environments.
cd ~/.config/awesome
git clone git://github.com/optama/awmodoro.git
Example configuration, in rc.lua:
local awmodoro = require("awmodoro")
--pomodoro wibox
pomowibox = awful.wibar({ position = "top", screen = 1, height = 5 })
pomowibox.visible = false
local pomodoro = awmodoro.new({
minutes = 1,
do_notify = true,
active_bg_color = "#313131",
paused_bg_color = "#7746D7",
fg_color = {
type = "linear",
from = { 0, 0 },
to = { pomowibox.width, 0 },
stops = { { 0, "#AECF96" }, { 0.5, "#88A175" }, { 1, "#FF5656" } },
},
width = pomowibox.width,
height = pomowibox.height,
begin_callback = function()
for s in screen do
s.mywibox.visible = false
end
pomowibox.visible = true
end,
finish_callback = function()
for s in screen do
s.mywibox.visible = true
end
pomowibox.visible = false
end,
})
pomowibox:set_widget(pomodoro)
In globalkeys:
awful.key({ modkey }, "p", function () pomodoro:toggle() end),
awful.key({ modkey, "Shift" }, "p", function () pomodoro:finish() end),
This creates a separate minimal and initially hidden wibox containing only the awmodoro widget. We set callbacks to hide other wiboxes at start and to show them again when finished. We add a keyboard shortcut to start a session and yes one to also end one ;-)
Default mouse bindings are
- Button 1 Toggle pause/resume
- Button 2 (mid) End session
- Button 3 Reset timer
These can be overriden by adding and changing
pomodoro:buttons(awful.util.table.join(
awful.button({ }, 1, function() pomodoro:toggle() end),
awful.button({ }, 2, function() pomodoro:finish() end),
awful.button({ }, 3, function() pomodoro:reset() end)
))
minutes Minutes defining duration of a session.
active_bg_color Background color of progress bar when timer is running.
paused_bg_color Background color of progress bar when timer is paused.
fg_color Foreground color(s) of progress bar.
do_notify Boolean value specifying wether notifications should be shown at begin, pause, resume, finish and reset.
width Width of widget.
height Height of widget.
Colors are provided according to format specified by http://awesome.naquadah.org/doc/api/modules/gears.color.html
If you prefer indivisible sessions (no ability to pause) then instead of pomodoro:toggle() use pomodoro:begin() and override mouse button 1 to something else but toggle/pause.
- Ability to have custom icons
- Add notification sound
- Keep a track of number of Pomodoros
- Have a way to continuously keep running Pomodoros with configurable breaks