X-Git-Url: https://git.rmz.io/dotfiles.git/blobdiff_plain/35a20af4d32304a899c86fab877dad93f12a6342..597280813177434105e78ba0933b0fd867a03edd:/awesome/widgets/pomodoro.lua
diff --git a/awesome/widgets/pomodoro.lua b/awesome/widgets/pomodoro.lua
index ff158c1..c83accf 100644
--- a/awesome/widgets/pomodoro.lua
+++ b/awesome/widgets/pomodoro.lua
@@ -10,11 +10,36 @@ pomodoro.work_duration = 25 * 60
-- format string
pomodoro.format = function (t) return " "..t.."" end
-pomodoro.auto_start_pomodoro = false
+pomodoro.auto_start_pomodoro = true
pomodoro.init()
-pombox = wibox.layout.fixed.horizontal()
+local pombox = wibox.layout.fixed.horizontal()
+pombox:add(wibox.widget {
+ layout = wibox.layout.align.horizontal,
+ forced_width = 200,
+ expand = "outside",
+ nil,
+ {
+ layout = wibox.container.scroll.horizontal,
+ max_size = 200,
+ extra_space = 10,
+ step_function = wibox.container.scroll.step_functions.linear_increase,
+ speed = 20,
+ {
+ -- TODO: make this context aware
+ widget = awful.widget.watch('task +ACTIVE _unique description',
+ 1,
+ function(widget, stdout)
+ if not stdout or stdout == "" then
+ stdout = "No task started!"
+ end
+ widget:set_markup(''..stdout..'')
+ end)
+ },
+ },
+ nil,
+})
pombox:add(pomodoro.icon_widget)
pombox:add(pomodoro.widget)
@@ -23,7 +48,7 @@ pombox:add(pomodoro.widget)
-- pomodoro:connect_signal("stop_pause", function () naughty.notify{ text = "stop_pause", timeout = 10 } end)
-- pomodoro:connect_signal("start_working", function () naughty.notify{ text = "start_working", timeout = 10 } end)
pomodoro:connect_signal("work_stop", function ()
- utils.spawn_terminal("diary", { instance = "diary" })
+ awful.spawn(terminal, {floating = true, placement = awful.centered })
end)
globalkeys = gears.table.join(globalkeys,