Add notion and some other stuff

This commit is contained in:
2017-01-29 03:03:12 +03:00
parent 22b6ed39dc
commit 1fa4ecee5a
22 changed files with 2051 additions and 64 deletions

View File

@@ -0,0 +1,41 @@
local task_base_settings = {
update_interval = 30*1000, -- every minute
}
local task_settings = task_base_settings
local task_timer
-- Read the active task
local function read_task_data ()
local f = assert(io.popen("/usr/bin/task statusd limit:1 | head -n 4 | tail -n 1"))
local data = f:read("*all")
f:close()
return data
end
-- Write the current state to the statusbar:
local function inform_task ()
local task = read_task_data()
statusd.inform("taskwarrior", task)
end
-- Statusbar update loop:
local function update_task ()
inform_task()
task_timer:set(task_settings.update_interval, update_task)
end
-- Run the script:
if statusd then
-- we're a statusbar plugin:
task_settings = table.join(statusd.get_config("task"), task_base_settings)
task_timer = statusd.create_timer()
update_task()
end
-- vim: set ts=4 sw=4 expandtab