]> git.rmz.io Git - dotfiles.git/blobdiff - awesome/widgets/pomodoro.lua
lazyvim: absorb icons into rmz.util.ui
[dotfiles.git] / awesome / widgets / pomodoro.lua
index e55b1e4dddf9f43bf0ae21f0f03cbb6691178b59..096952c470395278305b923939203710306764ce 100644 (file)
@@ -1,5 +1,7 @@
 local pomodoro = require("widgets/pomodoro/init")
 local wibox = require("wibox")
 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
 
 -- durations in seconds
 pomodoro.short_pause_duration = 5 * 60
@@ -8,21 +10,24 @@ pomodoro.work_duration = 25 * 60
 
 -- format string
 pomodoro.format = function (t) return " <b>"..t.."</b>" end
 
 -- format string
 pomodoro.format = function (t) return " <b>"..t.."</b>" end
+pomodoro.auto_start_pomodoro = false
 
 pomodoro.init()
 
 
 pomodoro.init()
 
-pombox = wibox.layout.fixed.horizontal()
+local pombox = wibox.layout.fixed.horizontal()
 pombox:add(pomodoro.icon_widget)
 pombox:add(pomodoro.widget)
 
 --TODO connect signals to something sensible  (sb:20170130)
 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 ()
+    awful.spawn(terminal, {floating = true, placement = awful.centered })
+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
 )
 
 return pombox