diff options
author | delta <darkussdelta@gmail.com> | 2024-03-05 14:48:59 +0100 |
---|---|---|
committer | delta <darkussdelta@gmail.com> | 2024-03-05 14:48:59 +0100 |
commit | 510ef8e178929cf5e0c7fd5a5120fecf5f1b79f2 (patch) | |
tree | 3582e5cd7d000335ca94f2a009f3aed57bd86919 /.config/awesome/ui/statusbar/init.lua | |
parent | 95ba8030f722a616cff06c122dcfb2f63e25cf45 (diff) |
idk anymore
Diffstat (limited to '.config/awesome/ui/statusbar/init.lua')
-rw-r--r-- | .config/awesome/ui/statusbar/init.lua | 75 |
1 files changed, 32 insertions, 43 deletions
diff --git a/.config/awesome/ui/statusbar/init.lua b/.config/awesome/ui/statusbar/init.lua index d4f2001..77a28f7 100644 --- a/.config/awesome/ui/statusbar/init.lua +++ b/.config/awesome/ui/statusbar/init.lua @@ -1,9 +1,8 @@ local awful = require "awful" local beautiful = require "beautiful" -local gcolor = require "gears.color" local panel = require "ui.statusbar.panel" local phosphor = require "assets.phosphor" -local qbind = require "quarrel.bind" +local qstore = require "quarrel.store" local qui = require "quarrel.ui" local qvars = require "quarrel.vars" local rubato = require "lib.rubato" @@ -13,38 +12,26 @@ local clock = require "ui.statusbar.widgets.clock" local displays = require "ui.statusbar.widgets.displays" local keyboardlayout = require "ui.statusbar.widgets.keyboardlayout" local taglist = require "ui.statusbar.widgets.taglist" +local tasklist = require "ui.statusbar.widgets.tasklist" screen.connect_signal("request::desktop_decoration", function(s) - local expand_button = wibox.widget { - widget = wibox.container.place, - valign = "center", - halign = "center", - { - widget = wibox.widget.imagebox, - image = gcolor.recolor_image(phosphor.caret_right_fill, qvars.colors.fg), - forced_width = qvars.char_height, - forced_height = qvars.char_height - }, - _expanded = false - } - local bar = qui.popup { placement = function(d) - local place = awful.placement.left - return place(d, { - margins = beautiful.useless_gap * 2 + return awful.placement.left(d, { + margins = beautiful.useless_gap * 2, }) end, minimum_height = s.geometry.height - (beautiful.useless_gap * 4 + qvars.border_width * 2), widget = { { { - expand_button, - taglist, + taglist(s), layout = wibox.layout.fixed.vertical, spacing = qvars.padding * 2, + id = "top", }, nil, + -- tasklist(s), { widget = wibox.container.place, valign = "bottom", @@ -55,11 +42,16 @@ screen.connect_signal("request::desktop_decoration", function(s) displays.wifi, { widget = wibox.container.place, - keyboardlayout + { + widget = wibox.container.constraint, + height = qvars.char_height, + width = qvars.char_height, + keyboardlayout, + }, }, clock, layout = wibox.layout.fixed.vertical, - spacing = qvars.padding * 2 + spacing = qvars.padding * 2, }, }, layout = wibox.layout.align.vertical, @@ -74,23 +66,24 @@ screen.connect_signal("request::desktop_decoration", function(s) local bar_width = bar.width + qvars.border_width * 2 bar:struts { - left = bar_width + beautiful.useless_gap * 4 + left = bar_width + beautiful.useless_gap * 4, } local panel_width + local panel_toggle = { toggled = false } -- hacky but it works local timed = rubato.timed { duration = qvars.anim_duration, intro = qvars.anim_intro, pos = bar_width, subscribed = function(pos) - if pos ~= bar_width and expand_button._expanded then + if pos ~= bar_width and panel_toggle.toggled then bar.widget.widget.third = panel if panel_width == nil then panel_width = bar.widget.widget.third.width end bar.ontop = true - elseif pos == bar_width and not expand_button._expanded then + elseif pos == bar_width and not panel_toggle.toggled then bar.widget.widget.third = nil bar.ontop = false end @@ -98,25 +91,21 @@ screen.connect_signal("request::desktop_decoration", function(s) bar.shape = function(cr, _, h) qvars.shape(cr, pos, h) end - end + end, } - expand_button.buttons = { - qbind:new { - triggers = qvars.btns.left, - press = function() - if expand_button._expanded then - timed.target = bar_width - else - timed.target = bar_width + qvars.expanded_bar_size - -- timed.target = bar_width + qvars.big_padding + (qvars.big_padding * 2 + qvars.element_size * 4) * 3 + qvars.padding * 2 - end - - -- q.debug(tostring(panel_width)) - expand_button._expanded = not expand_button._expanded - end, - hidden = true - } + panel_toggle = qui.toggle { + off = phosphor.arrows_out_simple_fill, + on = phosphor.arrows_in_simple_fill, + press = function(self) + if not self.toggled then + timed.target = bar_width + else + timed.target = bar_width + qvars.expanded_bar_size + end + end, } - + + bar.widget:get_children_by_id("top")[1]:insert(1, panel_toggle) + qstore.panel_toggle = panel_toggle end) |