You are not logged in.
How do I make my own Awesome WM Widget? I want to make a todo list. I am not afraid of learning Lua. Here is a quickly made mockup:
https://imgur.com/ePIJwPd
You can see that it is a simplified version of the default settings of Awesome, where I have added a box icon and a menu (adjusted to the side to fit it in). I could do the Todo handling myself but how, would I have Awesome display it?
Offline
Definitely looks doable. You probably won't need super advanced lua, but you'll want to know the basics at least. Once you're familiar with the basics, check out the Awesome API documentation. On your wibar, you'll have an awful.widget.launcher or even just an awful.widget.textbox, and assign it buttons which open or close the widget for the todo list. That'll probably be something like an awful.popup; inside that you'll have a more sophisticated widget layout so check out the info on the widget system and declarative layouts; the entire list will have a vertical layout, but inside that there'll be containers for each item with a horizontal layout, with a wibox.widget.textbox and wibox.widget.checkbox (and then probably an awful.widget.prompt for the last one).
You may need to add some kind of means for removing items from the list, unless you want it to grow forever; maybe by right clicking on the textbox for the item or something?
And presumably you want this persistent between boots so you'll want to save the data on change and reload when needed, but I gather you've got that part figured out?
Offline
I try to copy this sample from https://awesomewm.org/doc/api/documenta … ut.md.html but it does not show anything:
local bg = wibox.container.background()
bg:set_bg("#ff0000")
local tb1 = wibox.widget.textbox()
local tb2 = wibox.widget.textbox("bar")
tb1:set_text("foo")
tb2:set_text("bar")
local l = wibox.layout.fixed.vertical()
l:add(tb1)
l:add(tb2)
bg:set_widget(l)
Offline
Why would it? You didn't put it anywhere. Where would you like it to show up?
E.g., if you are using something like the default config, you could put it in the wibar. Just add "bg" where you want it to show up:
s.mywibox:setup {
layout = wibox.layout.align.horizontal,
{ -- Left widgets
layout = wibox.layout.fixed.horizontal,
mylauncher,
s.mytaglist,
s.mypromptbox,
},
s.mytasklist, -- Middle widget
{ -- Right widgets
layout = wibox.layout.fixed.horizontal,
bg, -- WIDGET ADDED HERE
mykeyboardlayout,
wibox.widget.systray(),
mytextclock,
s.mylayoutbox,
},
}
Last edited by frabjous (2022-05-28 18:47:59)
Offline
Added it just before the keyboard config thing, but it didn't show up.
Offline
It should have. If you post your config at a pastebin site and link here, I'll take a look.
Offline
Here it is:
https://pastebin.com/Dyd2Gfzm
Offline