aboutsummaryrefslogtreecommitdiff
path: root/.config/awesome/ui/statusbar/widgets
diff options
context:
space:
mode:
authordelta <darkussdelta@gmail.com>2025-07-04 00:38:29 +0200
committerdelta <darkussdelta@gmail.com>2025-07-04 00:38:29 +0200
commitb3530d7c4a102935fa26498a160ee1dc6c1e9c03 (patch)
treed7751206a694bc5de2d6b34b0c077cfcd1855798 /.config/awesome/ui/statusbar/widgets
parentdf75ec5ed5e3848c497f0439acb43ec9246ad3e7 (diff)
:3
Diffstat (limited to '.config/awesome/ui/statusbar/widgets')
-rw-r--r--.config/awesome/ui/statusbar/widgets/displays.lua24
-rw-r--r--.config/awesome/ui/statusbar/widgets/taglist.lua32
-rw-r--r--.config/awesome/ui/statusbar/widgets/taglist_new.lua147
-rw-r--r--.config/awesome/ui/statusbar/widgets/tasklist.lua30
4 files changed, 177 insertions, 56 deletions
diff --git a/.config/awesome/ui/statusbar/widgets/displays.lua b/.config/awesome/ui/statusbar/widgets/displays.lua
index 62e4398..96cf84c 100644
--- a/.config/awesome/ui/statusbar/widgets/displays.lua
+++ b/.config/awesome/ui/statusbar/widgets/displays.lua
@@ -1,7 +1,7 @@
local battery = require "services.battery"
local phosphor = require "assets.phosphor"
+local qcolor = require "quarrel.color"
local qui = require "quarrel.ui"
-local qvars = require "quarrel.vars"
local wibox = require "wibox"
local function create_display(icon, color)
@@ -16,28 +16,32 @@ local function create_display(icon, color)
}
end
-local d_battery = create_display(phosphor.battery_vertical_warning_fill, qvars.colors.red)
+local d_battery = create_display(phosphor.battery_vertical_warning_fill, qcolor.palette.red())
battery:connect_signal("icon", function(_, icon, color)
d_battery.widget.image = icon
d_battery.widget.stylesheet = qui.recolor(color)
end)
-local d_brightness = create_display(phosphor.moon_fill, qvars.colors.fg)
-awesome.connect_signal("services::brightness::icon", function(icon, color)
- d_brightness.widget.image = icon
- d_brightness.widget.stylesheet = qui.recolor(color)
-end)
+-- local d_brightness = create_display(phosphor.moon_fill, qcolor.palette.fg())
+-- awesome.connect_signal("services::brightness::icon", function(icon, color)
+-- d_brightness.widget.image = icon
+-- d_brightness.widget.stylesheet = qui.recolor(color)
+-- end)
-local d_audio = create_display(phosphor.speaker_simple_slash_fill, qvars.colors.red)
+local d_audio = create_display(phosphor.speaker_simple_slash_fill, qcolor.palette.red())
awesome.connect_signal("services::audio::icon", function(icon, color)
d_audio.widget.image = icon
d_audio.widget.stylesheet = qui.recolor(color)
end)
-local d_wifi = create_display(phosphor.wifi_x_fill, qvars.colors.red)
+local d_wifi = create_display(phosphor.wifi_x_fill, qcolor.palette.red())
awesome.connect_signal("services::wifi::icon", function(icon, color)
d_wifi.widget.image = icon
d_wifi.widget.stylesheet = qui.recolor(color)
end)
-return { audio = d_audio, battery = d_battery, brightness = d_brightness, wifi = d_wifi }
+return {
+ audio = d_audio,
+ battery = d_battery, --[[brightness = d_brightness,]]
+ wifi = d_wifi,
+}
diff --git a/.config/awesome/ui/statusbar/widgets/taglist.lua b/.config/awesome/ui/statusbar/widgets/taglist.lua
index df114df..3b81173 100644
--- a/.config/awesome/ui/statusbar/widgets/taglist.lua
+++ b/.config/awesome/ui/statusbar/widgets/taglist.lua
@@ -10,7 +10,7 @@ return function(s)
screen = s,
filter = awful.widget.taglist.filter.all,
layout = {
- spacing = qvars.padding,
+ spacing = qui.PADDING,
layout = wibox.layout.fixed.vertical,
},
widget_template = {
@@ -21,8 +21,8 @@ return function(s)
self.widget = qui.icon {
icon = phosphor[next(tag:clients()) and "circle_fill" or "circle_bold"],
widget = {
- forced_height = qvars.char_height / 1.5,
- forced_width = qvars.char_height / 1.5,
+ forced_height = qui.CHAR_HEIGHT / 1.5,
+ forced_width = qui.CHAR_HEIGHT / 1.5,
},
}
-- self.widget = wibox.widget {
@@ -33,44 +33,44 @@ return function(s)
if tag.selected then
return
end
- self.widget.stylesheet = qui.recolor(qvars.colors.yellow)
+ self.widget.stylesheet = qui.recolor(qcolor.palette.yellow())
end)
self:connect_signal("mouse::leave", function()
if tag.selected then
return
end
- self.widget.stylesheet = qui.recolor(qvars.colors.fg)
+ self.widget.stylesheet = qui.recolor(qcolor.palette.fg())
end)
if tag.selected then
- self.widget.stylesheet = qui.recolor(qvars.colors.yellow)
+ self.widget.stylesheet = qui.recolor(qcolor.palette.yellow())
return
end
- self.widget.stylesheet = qui.recolor(qvars.colors.fg)
+ self.widget.stylesheet = qui.recolor(qcolor.palette.fg())
end,
update_callback = function(self, tag)
self.widget.image = phosphor[next(tag:clients()) and "circle_fill" or "circle_bold"]
if tag.selected then
- self.widget.stylesheet = qui.recolor(qvars.colors.yellow)
+ self.widget.stylesheet = qui.recolor(qcolor.palette.yellow())
else
- self.widget.stylesheet = qui.recolor(qvars.colors.fg)
+ self.widget.stylesheet = qui.recolor(qcolor.palette.fg())
end
end,
},
buttons = {
- qbind:new {
- triggers = qvars.btns.left,
+ qbind {
+ triggers = qbind.btns.left,
press = function(t)
t:view_only()
end,
hidden = true,
},
- qbind:new {
- mods = qvars.mods.M,
- triggers = qvars.btns.left,
+ qbind {
+ mods = qbind.mods.M,
+ triggers = qbind.btns.left,
press = function(t)
if client.focus then
client.focus:move_to_tag(t)
@@ -78,8 +78,8 @@ return function(s)
end,
hidden = true,
},
- qbind:new {
- triggers = qvars.btns.right,
+ qbind {
+ triggers = qbind.btns.right,
press = awful.tag.viewtoggle,
hidden = true,
},
diff --git a/.config/awesome/ui/statusbar/widgets/taglist_new.lua b/.config/awesome/ui/statusbar/widgets/taglist_new.lua
new file mode 100644
index 0000000..79b8a96
--- /dev/null
+++ b/.config/awesome/ui/statusbar/widgets/taglist_new.lua
@@ -0,0 +1,147 @@
+local awful = require "awful"
+local qbind = require "quarrel.bind"
+local qcolor = require "quarrel.color"
+local qui = require "quarrel.ui"
+local qvars = require "quarrel.vars"
+local wibox = require "wibox"
+
+local empty_indicator = wibox.widget {
+ widget = wibox.container.place,
+ {
+ widget = wibox.container.constraint,
+ strategy = "exact",
+ height = qui.PADDING,
+ width = qui.PADDING,
+ {
+ widget = wibox.container.background,
+ bg = qcolor.palette.border.variant,
+ shape = qui.shape,
+ },
+ },
+}
+
+local client_indicator = wibox.widget {
+ widget = wibox.container.place,
+ {
+ widget = wibox.container.constraint,
+ height = qui.CHAR_HEIGHT,
+ width = qui.PADDING,
+ strategy = "exact",
+ {
+ widget = wibox.container.background,
+ shape = qui.shape,
+ bg = qcolor.palette.fg(),
+ },
+ },
+}
+
+local function update_tasklist(layout, tag, indicated_empty)
+ local client_delta = #tag:clients() - #layout.children
+ if client_delta < 0 then
+ for _ = 1, -(client_delta + (indicated_empty and 1 or 0)) do
+ layout:remove(1)
+ end
+ elseif client_delta > 0 then
+ for _ = 1, client_delta do
+ layout:add(client_indicator)
+ end
+ end
+end
+
+return function(s)
+ return awful.widget.taglist {
+ screen = s,
+ filter = awful.widget.taglist.filter.all,
+ layout = {
+ spacing = qui.PADDING,
+ layout = wibox.layout.fixed.vertical,
+ },
+ widget_template = {
+ widget = wibox.container.constraint,
+ strategy = "min",
+ height = qui.CHAR_HEIGHT,
+ qui.styled {
+ widget = wibox.container.background,
+ bg = qcolor.palette.bg.high,
+ {
+ widget = wibox.container.margin,
+ margins = qui.PADDING,
+ {
+ layout = wibox.layout.flex.vertical,
+ spacing = qui.PADDING,
+ },
+ },
+ },
+ create_callback = function(
+ self,
+ tag --[[@as tag]]
+ )
+ if tag.selected then
+ self.widget.border_color = qcolor.palette.yellow()
+ end
+
+ if #tag:clients() ~= 0 then
+ self.widget.widget.spacing = qui.PADDING
+ if self.indicated_empty then
+ self.widget.widget.widget:remove(1)
+ self.indicated_empty = false
+ end
+ else
+ if not self.indicated_empty then
+ self.widget.widget.widget:add(empty_indicator)
+ self.indicated_empty = true
+ end
+ end
+
+ update_tasklist(self.widget.widget.widget, tag, self.indicated_empty)
+ end,
+ update_callback = function(self, tag)
+ if tag.selected then
+ self.widget.border_color = qcolor.palette.yellow()
+ else
+ self.widget.border_color = qcolor.palette.border()
+ end
+
+ if #tag:clients() ~= 0 then
+ self.widget.widget.spacing = qui.PADDING
+ if self.indicated_empty then
+ self.widget.widget.widget:remove(1)
+ self.indicated_empty = false
+ end
+ else
+ self.widget.widget.spacing = nil
+ if not self.indicated_empty then
+ self.widget.widget.widget:add(empty_indicator)
+ self.indicated_empty = true
+ end
+ end
+
+ update_tasklist(self.widget.widget.widget, tag, self.indicated_empty)
+ end,
+ },
+ buttons = {
+ qbind {
+ triggers = qbind.btns.left,
+ press = function(t)
+ t:view_only()
+ end,
+ hidden = true,
+ },
+ qbind {
+ mods = qbind.mods.M,
+ triggers = qbind.btns.left,
+ press = function(t)
+ if client.focus then
+ client.focus:move_to_tag(t)
+ end
+ end,
+ hidden = true,
+ },
+ qbind {
+ triggers = qbind.btns.right,
+ press = awful.tag.viewtoggle,
+ hidden = true,
+ },
+ },
+ }
+end
diff --git a/.config/awesome/ui/statusbar/widgets/tasklist.lua b/.config/awesome/ui/statusbar/widgets/tasklist.lua
deleted file mode 100644
index 9656185..0000000
--- a/.config/awesome/ui/statusbar/widgets/tasklist.lua
+++ /dev/null
@@ -1,30 +0,0 @@
-local awful = require "awful"
-local gears = require "gears"
-local qvars = require "quarrel.vars"
-local wibox = require "wibox"
-
-return function(s)
- return awful.widget.tasklist {
- screen = s,
- filter = awful.widget.tasklist.filter.currenttags,
- -- buttons = tasklist_buttons,
- layout = {
- spacing = qvars.padding,
- layout = wibox.layout.flex.vertical,
- },
- widget_template = {
- widget = wibox.container.place,
- valign = "center",
- halign = "center",
- -- {
- -- widget = awful.widget.clienticon,
-
- -- }
- {
- widget = awful.widget.clienticon,
- forced_width = qvars.char_height,
- forced_height = qvars.char_height,
- },
- },
- }
-end