aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.config/awesome/rc.lua5
-rw-r--r--.config/awesome/todo.lua47
-rw-r--r--.local/etc/gittab/tabs/awesome1
3 files changed, 49 insertions, 4 deletions
diff --git a/.config/awesome/rc.lua b/.config/awesome/rc.lua
index a17014d..a171028 100644
--- a/.config/awesome/rc.lua
+++ b/.config/awesome/rc.lua
@@ -14,8 +14,7 @@ local hotkeys_popup = require("awful.hotkeys_popup").widget
-- when client with a matching name is opened:
require("awful.hotkeys_popup.keys")
--- Include modules
-local gtd_next_items = require("gtd_next_items")
+local todo = require("todo")
-- Error handling
-- Check if awesome encountered an error during startup and fell back to
@@ -124,7 +123,7 @@ mykeyboardlayout = awful.widget.keyboardlayout()
mytextclock = wibox.widget.textclock()
-- Add the GTD functionality
-gtd_next_items({}):attach(mytextclock)
+todo({}):attach(mytextclock)
-- Create a wibox for each screen and add it
local taglist_buttons = gears.table.join(
diff --git a/.config/awesome/todo.lua b/.config/awesome/todo.lua
new file mode 100644
index 0000000..83cf2d8
--- /dev/null
+++ b/.config/awesome/todo.lua
@@ -0,0 +1,47 @@
+local capi = {
+ mouse = mouse,
+ screen = screen,
+}
+local naughty = require("naughty")
+
+------------------------------------------
+-- todo.txt popup widget
+------------------------------------------
+
+local todo = {}
+
+function todo:new(args)
+ return setmetatable({}, {__index = self})
+end
+
+function todo:show()
+ local f = assert(io.open("/home/tyil/documents/todo.txt", "rb"))
+ local content = f:read("*all"):gsub("%s+$", "")
+ f:close()
+
+ self.notification = naughty.notify({
+ title = "Todo",
+ text = content,
+ timeout = 0,
+ hover_timeout = 0.5,
+ screen = capi.mouse.screen,
+ position = self.position,
+ })
+end
+
+function todo:hide()
+ if self.notification then
+ naughty.destroy(self.notification)
+ self.notification = nil
+ self.num_lines = 0
+ end
+end
+
+function todo:attach(widget)
+ widget:connect_signal('mouse::enter', function() self:show() end)
+ widget:connect_signal('mouse::leave', function() self:hide() end)
+end
+
+return setmetatable(todo, {
+ __call = todo.new,
+})
diff --git a/.local/etc/gittab/tabs/awesome b/.local/etc/gittab/tabs/awesome
index 7d7f2af..6414bc8 100644
--- a/.local/etc/gittab/tabs/awesome
+++ b/.local/etc/gittab/tabs/awesome
@@ -1,2 +1 @@
# Local name Remote URL Branch
-gtd_next_items https://gitlab.com/tyil/lua-gtd-awesome.git master