X-Git-Url: https://git.rmz.io/dotfiles.git/blobdiff_plain/4637883ba3ab217e97806c785c1eaa9f18dbaa79..refs/heads/lazyvim:/awesome/widgets/pomodoro.lua diff --git a/awesome/widgets/pomodoro.lua b/awesome/widgets/pomodoro.lua index e55b1e4..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() @@ -16,13 +19,15 @@ pombox:add(pomodoro.icon_widget) pombox:add(pomodoro.widget) --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("start_pause", function () naughty.notify{ text = "start_pause", timeout = 10 } end) +-- 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 = awful.util.table.join(globalkeys, - awful.key({ modkey, "Shift" }, "p", function() pomodoro:start() end) +globalkeys = gears.table.join(globalkeys, + awful.key({ modkey, "Shift" }, "p", function() pomodoro:toggle() end) ) return pombox