From: Samir Benmendil Date: Thu, 4 Jun 2015 21:59:20 +0000 (+0100) Subject: awesome: add pomodoro widget X-Git-Url: https://git.rmz.io/dotfiles.git/commitdiff_plain/f2199b615e1624b4de93075a40a38b68d9aa8e15 awesome: add pomodoro widget --- diff --git a/awesome/topbar.lua b/awesome/topbar.lua index 7986af0..91b04fa 100644 --- a/awesome/topbar.lua +++ b/awesome/topbar.lua @@ -89,6 +89,8 @@ for s = 1, screen.count() do local right_layout = wibox.layout.fixed.horizontal() if s == 1 then right_layout:add(wibox.widget.systray()) end right_layout:add(separator) + right_layout:add(require("widgets/pomodoro")) + right_layout:add(separator) right_layout:add(require("widgets/awesompd")) right_layout:add(require("widgets/volume_widget")) if utils.host == "chronos" then diff --git a/awesome/widgets/pomodoro b/awesome/widgets/pomodoro new file mode 160000 index 0000000..a861385 --- /dev/null +++ b/awesome/widgets/pomodoro @@ -0,0 +1 @@ +Subproject commit a861385355d0ac10091eda49757fc9eda05480a3 diff --git a/awesome/widgets/pomodoro.lua b/awesome/widgets/pomodoro.lua new file mode 100644 index 0000000..3c7af63 --- /dev/null +++ b/awesome/widgets/pomodoro.lua @@ -0,0 +1,22 @@ +local pomodoro = require("widgets/pomodoro/init") +local wibox = require("wibox") + +-- durations in seconds +pomodoro.short_pause_duration = 5 * 60 +pomodoro.long_pause_duration = 30 * 60 +pomodoro.work_duration = 25 * 60 + +-- format string +pomodoro.format = function (t) return " "..t.."" end + +pomodoro.init() + +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) +) + +return pombox