X-Git-Url: https://git.rmz.io/dotfiles.git/blobdiff_plain/11073fc991d811c247ee7adfe2680a47148884cc..ccdacf21dc7d84e54dc22e5398d5ecb4fb2912ec:/awesome/widgets/pomodoro.lua diff --git a/awesome/widgets/pomodoro.lua b/awesome/widgets/pomodoro.lua index 46ca538..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() @@ -19,12 +22,12 @@ pombox:add(pomodoro.widget) -- 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 () - awful.spawn(terminal.." -name diary -e diary") +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