aboutsummaryrefslogtreecommitdiff
path: root/.config/awesome/ui/statusbar/widgets
diff options
context:
space:
mode:
authordelta <darkussdelta@gmail.com>2023-05-21 10:12:46 +0200
committerdelta <darkussdelta@gmail.com>2023-05-21 10:12:46 +0200
commitf42a3a2cc941e34dd938b1e6bc24785a44781db2 (patch)
treebec91db370c7bcd5be2bb614d2d315a32c751215 /.config/awesome/ui/statusbar/widgets
parentf5612f081db0dc69f5c0ebc69e67fa3b098a9ad9 (diff)
major update of awesome config
add new icons, switch over to using stylesheets instead of gears.color.recolor_image, add a music widget to the panel, optimize services in common.lua, fix the application lense filtering and increase the update rate of services in common.lua Signed-off-by: delta <darkussdelta@gmail.com>
Diffstat (limited to '.config/awesome/ui/statusbar/widgets')
-rw-r--r--.config/awesome/ui/statusbar/widgets/battery.lua32
-rw-r--r--.config/awesome/ui/statusbar/widgets/brightness.lua32
-rw-r--r--.config/awesome/ui/statusbar/widgets/displays.lua39
-rw-r--r--.config/awesome/ui/statusbar/widgets/taglist.lua25
-rw-r--r--.config/awesome/ui/statusbar/widgets/volume.lua36
-rw-r--r--.config/awesome/ui/statusbar/widgets/wifi.lua38
6 files changed, 48 insertions, 154 deletions
diff --git a/.config/awesome/ui/statusbar/widgets/battery.lua b/.config/awesome/ui/statusbar/widgets/battery.lua
deleted file mode 100644
index f220ff1..0000000
--- a/.config/awesome/ui/statusbar/widgets/battery.lua
+++ /dev/null
@@ -1,32 +0,0 @@
-local gcolor = require "gears.color"
-local phosphor = require "assets.phosphor"
-local qmath = require "quarrel.math"
-local qvars = require "quarrel.vars"
-local wibox = require "wibox"
-
-local battery = wibox.widget {
- widget = wibox.container.place,
- valign = "center",
- halign = "center",
- {
- widget = wibox.widget.imagebox,
- image = gcolor.recolor_image(phosphor.battery_vertical_warning_fill, qvars.colors.red),
- forced_width = qvars.char_height,
- forced_height = qvars.char_height
- }
-}
-
-awesome.connect_signal("services::battery", function(capacity, status)
- local icon_data = status == "Charging" and { "charging", "green" } or qmath.step_value(capacity, {
- { 0, { "empty", "red" } },
- { 20, { "low", "red" } },
- { 40, { "medium", "yellow" } },
- { 60, { "high", "green" } },
- { 80, { "full", "green" } },
- { 100 }
- })
-
- battery.widget.image = gcolor.recolor_image(phosphor["battery_vertical_" .. icon_data[1] .. "_fill"], qvars.colors[icon_data[2]])
-end)
-
-return battery
diff --git a/.config/awesome/ui/statusbar/widgets/brightness.lua b/.config/awesome/ui/statusbar/widgets/brightness.lua
deleted file mode 100644
index bfb8e91..0000000
--- a/.config/awesome/ui/statusbar/widgets/brightness.lua
+++ /dev/null
@@ -1,32 +0,0 @@
-local gcolor = require "gears.color"
-local phosphor = require "assets.phosphor"
-local qmath = require "quarrel.math"
-local qvars = require "quarrel.vars"
-local wibox = require "wibox"
-
-local brightness = wibox.widget {
- widget = wibox.container.place,
- valign = "center",
- halign = "center",
- {
- widget = wibox.widget.imagebox,
- image = gcolor.recolor_image(phosphor.moon_fill, qvars.colors.fg),
- forced_width = qvars.char_height,
- forced_height = qvars.char_height
- }
-}
-
-awesome.connect_signal("services::brightness", function(value)
- local icon_data = qmath.step_value(value, {
- { 0, "cloud_moon" },
- { 51, "moon" },
- { 102, "sun_horizon" },
- { 153, "sun_dim" },
- { 204, "sun" },
- { 255 }
- })
-
- brightness.widget.image = gcolor.recolor_image(phosphor[icon_data .. "_fill"], qvars.colors.fg)
-end)
-
-return brightness
diff --git a/.config/awesome/ui/statusbar/widgets/displays.lua b/.config/awesome/ui/statusbar/widgets/displays.lua
new file mode 100644
index 0000000..44ff2c6
--- /dev/null
+++ b/.config/awesome/ui/statusbar/widgets/displays.lua
@@ -0,0 +1,39 @@
+local phosphor = require "assets.phosphor"
+local qui = require "quarrel.ui"
+local qvars = require "quarrel.vars"
+local wibox = require "wibox"
+
+local function create_display(icon, color)
+ return wibox.widget {
+ widget = wibox.container.place,
+ valign = "center",
+ halign = "center",
+ qui.icon(icon, color)
+ }
+end
+
+local battery = create_display(phosphor.battery_vertical_warning_fill, qvars.colors.red)
+awesome.connect_signal("services::battery::icon", function(icon, color)
+ battery.widget.image = icon
+ battery.widget.stylesheet = qui.recolor(color)
+end)
+
+local brightness = create_display(phosphor.moon_fill, qvars.colors.fg)
+awesome.connect_signal("services::brightness::icon", function(icon, color)
+ brightness.widget.image = icon
+ brightness.widget.stylesheet = qui.recolor(color)
+end)
+
+local audio = create_display(phosphor.speaker_simple_slash_fill, qvars.colors.red)
+awesome.connect_signal("services::audio::icon", function(icon, color)
+ audio.widget.image = icon
+ audio.widget.stylesheet = qui.recolor(color)
+end)
+
+local wifi = create_display(phosphor.wifi_x_fill, qvars.colors.red)
+awesome.connect_signal("services::wifi::icon", function(icon, color)
+ wifi.widget.image = icon
+ wifi.widget.stylesheet = qui.recolor(color)
+end)
+
+return { audio = audio, battery = battery, brightness = brightness, wifi = wifi }
diff --git a/.config/awesome/ui/statusbar/widgets/taglist.lua b/.config/awesome/ui/statusbar/widgets/taglist.lua
index 10618aa..1072426 100644
--- a/.config/awesome/ui/statusbar/widgets/taglist.lua
+++ b/.config/awesome/ui/statusbar/widgets/taglist.lua
@@ -1,7 +1,9 @@
local awful = require "awful"
local gcolor = require "gears.color"
+local gdebug = require "gears.debug"
local phosphor = require "assets.phosphor"
local qbind = require "quarrel.bind"
+local qui = require "quarrel.ui"
local qvars = require "quarrel.vars"
local wibox = require "wibox"
@@ -16,42 +18,33 @@ return awful.widget.taglist {
widget = wibox.container.place,
valign = "center",
halign = "center",
- {
- widget = wibox.widget.imagebox,
- image = gcolor.recolor_image(phosphor.circle_bold, qvars.colors.fg),
- forced_width = qvars.char_height,
- forced_height = qvars.char_height,
- icon = phosphor.dot_fill
- },
create_callback = function(self, tag)
- -- self.widget.icon = phosphor[next(tag:clients()) and "circle_fill" or "circle_bold"]
+ self.widget = qui.icon(tag.icon)
self:connect_signal("mouse::enter", function()
if tag.selected then return end
-
- self.widget.image = gcolor.recolor_image(self.widget.icon, qvars.colors.yellow)
+ self.widget.stylesheet = qui.recolor(qvars.colors.yellow)
end)
self:connect_signal("mouse::leave", function()
if tag.selected then return end
-
- self.widget.image = gcolor.recolor_image(self.widget.icon, qvars.colors.fg)
+ self.widget.stylesheet = qui.recolor(qvars.colors.fg)
end)
if tag.selected then
- self.widget.image = gcolor.recolor_image(self.widget.icon, qvars.colors.yellow)
+ self.widget.stylesheet = qui.recolor(qvars.colors.yellow)
return
end
- self.widget.image = gcolor.recolor_image(self.widget.icon, qvars.colors.fg)
+ self.widget.stylesheet = qui.recolor(qvars.colors.fg)
end,
update_callback = function(self, tag)
-- self.widget.icon = phosphor[next(tag:clients()) and "circle_fill" or "circle_bold"]
if tag.selected then
- self.widget.image = gcolor.recolor_image(self.widget.icon, qvars.colors.yellow)
+ self.widget.stylesheet = qui.recolor(qvars.colors.yellow)
else
- self.widget.image = gcolor.recolor_image(self.widget.icon, qvars.colors.fg)
+ self.widget.stylesheet = qui.recolor(qvars.colors.fg)
end
end
},
diff --git a/.config/awesome/ui/statusbar/widgets/volume.lua b/.config/awesome/ui/statusbar/widgets/volume.lua
deleted file mode 100644
index 72723a0..0000000
--- a/.config/awesome/ui/statusbar/widgets/volume.lua
+++ /dev/null
@@ -1,36 +0,0 @@
-local gcolor = require "gears.color"
-local phosphor = require "assets.phosphor"
-local qmath = require "quarrel.math"
-local qvars = require "quarrel.vars"
-local wibox = require "wibox"
-
-local volume_widget = wibox.widget {
- widget = wibox.container.place,
- valign = "center",
- halign = "center",
- {
- widget = wibox.widget.imagebox,
- image = gcolor.recolor_image(phosphor.speaker_simple_slash_fill, qvars.colors.red),
- forced_width = qvars.char_height,
- forced_height = qvars.char_height
- }
-}
-
-awesome.connect_signal("services::audio", function(volume, muted)
- if muted then
- volume_widget.widget.image = gcolor.recolor_image(phosphor["speaker_simple_x_fill"], qvars.colors.red)
- return
- end
-
- local icon_data = qmath.step_value(volume, {
- { 0, "slash" },
- { 25, "none" },
- { 50, "low" },
- { 75, "high" },
- { 100 }
- })
-
- volume_widget.widget.image = gcolor.recolor_image(phosphor["speaker_simple_" .. icon_data .. "_fill"], qvars.colors.fg)
-end)
-
-return volume_widget
diff --git a/.config/awesome/ui/statusbar/widgets/wifi.lua b/.config/awesome/ui/statusbar/widgets/wifi.lua
deleted file mode 100644
index c895b0a..0000000
--- a/.config/awesome/ui/statusbar/widgets/wifi.lua
+++ /dev/null
@@ -1,38 +0,0 @@
-local gcolor = require "gears.color"
-local phosphor = require "assets.phosphor"
-local qmath = require "quarrel.math"
-local qvars = require "quarrel.vars"
-local wibox = require "wibox"
-local q = require "quarrel"
-local gdebug = require "gears.debug"
-
-local wifi = wibox.widget {
- widget = wibox.container.place,
- valign = "center",
- halign = "center",
- {
- widget = wibox.widget.imagebox,
- image = gcolor.recolor_image(phosphor.wifi_x_fill, qvars.colors.red),
- forced_width = qvars.char_height,
- forced_height = qvars.char_height
- }
-}
-
-awesome.connect_signal("services::wifi", function(essid, strength, connected)
- if not connected then
- wifi.widget.image = gcolor.recolor_image(phosphor.wifi_x_fill, qvars.colors.red)
- return
- end
-
- local icon_data = qmath.step_value(strength, {
- { 0, { "none", "red" } },
- { 25, { "low", "yellow" } },
- { 50, { "medium", "yellow" } },
- { 75, { "high", "green" } },
- { 100 }
- })
-
- wifi.widget.image = gcolor.recolor_image(phosphor["wifi_" .. icon_data[1] .. "_fill"], qvars.colors[icon_data[2]])
-end)
-
-return wifi