diff options
author | Tim Keller <tjkeller.xyz> | 2025-04-12 14:34:55 -0500 |
---|---|---|
committer | Tim Keller <tjkeller.xyz> | 2025-04-12 14:34:55 -0500 |
commit | 39f8a32b96c86a442c6cdc4aae7a870a5f65b45f (patch) | |
tree | 301b6b623f80838de954c8afdd0d19cb2665f11a /widgets | |
parent | 3ab998e85b7eb487d129530c5ec437259e305c81 (diff) | |
download | awesome-39f8a32b96c86a442c6cdc4aae7a870a5f65b45f.tar.xz awesome-39f8a32b96c86a442c6cdc4aae7a870a5f65b45f.zip |
cleanup and tasklist tooltip + wibox tooltip lib
Diffstat (limited to 'widgets')
-rw-r--r-- | widgets/tasklist.lua | 75 |
1 files changed, 75 insertions, 0 deletions
diff --git a/widgets/tasklist.lua b/widgets/tasklist.lua new file mode 100644 index 0000000..5caac3e --- /dev/null +++ b/widgets/tasklist.lua @@ -0,0 +1,75 @@ +local awful = require("awful") +local wibox = require("wibox") +local wibox_tooltip = require("lib.wiboxtooltip") +local beautiful = require("beautiful") + +local separator = { widget = wibox.widget.separator, opacity = 0 } + +function tooltip_tag_clients() + local text = "" + for _, c in ipairs(awful.screen.focused():get_clients(false)) do + local ctext = c.name + if c == client.focus then + ctext = "* " .. ctext + end + text = text .. ctext .. "\n" + end + return text:sub(1, -2) -- remove last newline +end + +function create_tasklist(s) + local tasklist = wibox.widget { + layout = wibox.layout.align.horizontal, + expand = "outside", + separator, + awful.widget.tasklist { + screen = s, + filter = awful.widget.tasklist.filter.focused, + buttons = tasklist_buttons, + widget_template = { + id = "text_role", + widget = wibox.widget.textbox, + align = "center", + }, + }, + separator, + } + + local popup = wibox_tooltip(tasklist, awful.widget.tasklist { + screen = s, + filter = awful.widget.tasklist.filter.currenttags, + layout = { + layout = wibox.layout.fixed.vertical, + }, + widget_template = { + id = "text_role", + widget = wibox.widget.textbox, + align = "center", + }, + style = { + font_focus = beautiful.font_mono_bold, + }, + }) + + return tasklist +end + +---- signal for changing tasklist filter based on layout +---- DOESNT WORK TODO +--local naughty = require("naughty") +--s:connect_signal("property::layout", function() +-- naughty.notify({ +-- title = "Hello, AwesomeWM!", +-- text = "This is a notification.", +-- timeout = 5, -- Timeout in seconds +-- position = "top_right" -- Position on the screen +-- }) +-- if awful.layout.get(s) == awful.layout.suit.max then +-- s.mytasklist.filter = awful.widget.tasklist.filter.currenttags +-- else +-- s.mytasklist.filter = awful.widget.tasklist.filter.focused +-- end +--end +--) + +return create_tasklist |