X-Git-Url: https://git.rmz.io/dotfiles.git/blobdiff_plain/f2199b615e1624b4de93075a40a38b68d9aa8e15..24e3ac6deff61a37dfcb46eb662c59fa5215a501:/awesome/widgets/pomodoro.lua diff --git a/awesome/widgets/pomodoro.lua b/awesome/widgets/pomodoro.lua index 3c7af63..ff158c1 100644 --- a/awesome/widgets/pomodoro.lua +++ b/awesome/widgets/pomodoro.lua @@ -1,5 +1,7 @@ local pomodoro = require("widgets/pomodoro/init") local wibox = require("wibox") +local awful = require("awful") +local utils = require("utils") -- durations in seconds pomodoro.short_pause_duration = 5 * 60 @@ -8,6 +10,7 @@ pomodoro.work_duration = 25 * 60 -- format string pomodoro.format = function (t) return " "..t.."" end +pomodoro.auto_start_pomodoro = false pomodoro.init() @@ -15,8 +18,16 @@ pombox = wibox.layout.fixed.horizontal() pombox:add(pomodoro.icon_widget) pombox:add(pomodoro.widget) -globalkeys = awful.util.table.join(globalkeys, - awful.key({ modkey, "Shift" }, "p", function() pomodoro:start() end) +--TODO connect signals to something sensible (sb:20170130) +-- pomodoro:connect_signal("stop_working", function () naughty.notify{ text = "stop_working", timeout = 10 } end) +-- 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" }) +end) + +globalkeys = gears.table.join(globalkeys, + awful.key({ modkey, "Shift" }, "p", function() pomodoro:toggle() end) ) return pombox