aboutsummaryrefslogtreecommitdiff
path: root/.config/awesome/components/statusbar
diff options
context:
space:
mode:
authordelta <darkussdelta@gmail.com>2023-03-04 22:04:55 +0100
committerdelta <darkussdelta@gmail.com>2023-03-04 22:18:21 +0100
commitf0b32f45746c026d402651013b7e98315d6956a1 (patch)
treef42609e98522da081cebdd21a674a702d1054bbc /.config/awesome/components/statusbar
parenta0f8b5fa6acdd1c2477fb1881dd9067956bf0ae6 (diff)
restructure awesome config, add fresnel
Diffstat (limited to '.config/awesome/components/statusbar')
-rw-r--r--.config/awesome/components/statusbar/battery.lua78
-rw-r--r--.config/awesome/components/statusbar/brightness.lua33
-rw-r--r--.config/awesome/components/statusbar/clock.lua32
-rw-r--r--.config/awesome/components/statusbar/init.lua57
-rw-r--r--.config/awesome/components/statusbar/taglist.lua86
-rw-r--r--.config/awesome/components/statusbar/wifi.lua60
6 files changed, 0 insertions, 346 deletions
diff --git a/.config/awesome/components/statusbar/battery.lua b/.config/awesome/components/statusbar/battery.lua
deleted file mode 100644
index 670b200..0000000
--- a/.config/awesome/components/statusbar/battery.lua
+++ /dev/null
@@ -1,78 +0,0 @@
-local awful = require "awful"
-local xresources = require "beautiful.xresources"
-local dpi = xresources.apply_dpi
-local vars = require "themes.prismite.vars"
-local wibox = require "wibox"
-
-local battery_inner = awful.widget.watch("cat /sys/class/power_supply/BAT0/capacity", 1, function(widget, stdout)
- local icon = ""
- local color = vars.colors.red
-
- if io.popen("cat /sys/class/power_supply/BAT0/status"):read("*a"):sub(0, -2) == "Charging" then
- icon = ""
- color = vars.colors.green
- widget:set_markup("<span color=\"" .. color .. "\">" .. icon .. "</span>")
- return
- end
-
- local percent = tonumber(stdout)
-
- if percent <= 5 then
- icon = ""
- color = vars.colors.red
- elseif percent <= 10 then
- icon = ""
- color = vars.colors.red
- elseif percent <= 20 then
- icon = ""
- color = vars.colors.red
- elseif percent <= 30 then
- icon = ""
- color = vars.colors.yellow
- elseif percent <= 40 then
- icon = ""
- color = vars.colors.yellow
- elseif percent <= 50 then
- icon = ""
- color = vars.colors.yellow
- elseif percent <= 60 then
- icon = ""
- color = vars.colors.yellow
- elseif percent <= 70 then
- icon = ""
- color = vars.colors.yellow
- elseif percent <= 80 then
- icon = ""
- color = vars.colors.green
- elseif percent <= 90 then
- icon = ""
- color = vars.colors.green
- elseif percent <= 100 then
- icon = ""
- color = vars.colors.green
- end
-
- widget:set_markup("<span color=\"" .. color .. "\">" .. icon .. "</span>")
-end)
-
-local battery = wibox.widget {
- widget = wibox.container.place,
- battery_inner
-}
-
-awful.tooltip {
- objects = { battery },
- timer_function = function()
- return io.popen("cat /sys/class/power_supply/BAT0/capacity"):read("*a"):sub(0, -2) .. "%"
- end,
- bg = vars.colors.bg,
- fg = vars.colors.fg,
- border_color = vars.colors.bright.black,
- border_width = vars.border_width,
- font = vars.font,
- shape = vars.shape,
- margin_leftright = dpi(6),
- margin_topbottom = dpi(6)
-}
-
-return battery
diff --git a/.config/awesome/components/statusbar/brightness.lua b/.config/awesome/components/statusbar/brightness.lua
deleted file mode 100644
index eb37f06..0000000
--- a/.config/awesome/components/statusbar/brightness.lua
+++ /dev/null
@@ -1,33 +0,0 @@
-local awful = require "awful"
-local xresources = require "beautiful.xresources"
-local dpi = xresources.apply_dpi
-local vars = require "themes.prismite.vars"
-local wibox = require "wibox"
-
-
-local brightness = wibox.widget {
- widget = wibox.container.place,
- {
- widget = wibox.widget.textbox,
- font = vars.font,
- text = ""
- },
-}
-
-awful.tooltip {
- objects = { brightness },
- timer_function = function()
- return math.floor(tonumber(io.popen("brightnessctl g"):read("*a"):sub(0, -2)) / 255 * 100) .. "%"
- end,
- timeout = 0.5,
- bg = vars.colors.bg,
- fg = vars.colors.fg,
- border_color = vars.colors.bright.black,
- border_width = vars.border_width,
- font = vars.font,
- shape = vars.shape,
- margin_leftright = dpi(6),
- margin_topbottom = dpi(6)
-}
-
-return brightness
diff --git a/.config/awesome/components/statusbar/clock.lua b/.config/awesome/components/statusbar/clock.lua
deleted file mode 100644
index c88ea62..0000000
--- a/.config/awesome/components/statusbar/clock.lua
+++ /dev/null
@@ -1,32 +0,0 @@
-local awful = require "awful"
-local xresources = require "beautiful.xresources"
-local dpi = xresources.apply_dpi
-local vars = require "themes.prismite.vars"
-local wibox = require "wibox"
-
-
-local clock = wibox.widget {
- widget = wibox.container.place,
- {
- format = "%H\n%M",
- widget = wibox.widget.textclock,
- font = vars.font
- },
-}
-
-awful.tooltip {
- objects = { clock },
- timer_function = function()
- return os.date("%a %d/%m/%y")
- end,
- bg = vars.colors.bg,
- fg = vars.colors.fg,
- border_color = vars.colors.bright.black,
- border_width = vars.border_width,
- font = vars.font,
- shape = vars.shape,
- margin_leftright = dpi(6),
- margin_topbottom = dpi(6)
-}
-
-return clock
diff --git a/.config/awesome/components/statusbar/init.lua b/.config/awesome/components/statusbar/init.lua
deleted file mode 100644
index c798669..0000000
--- a/.config/awesome/components/statusbar/init.lua
+++ /dev/null
@@ -1,57 +0,0 @@
-local awful = require "awful"
-local beautiful = require "beautiful"
-local xresources = require "beautiful.xresources"
-local dpi = xresources.apply_dpi
-local vars = require "themes.prismite.vars"
-local wibox = require "wibox"
-
-local taglist = require "components.statusbar.taglist"
-local clock = require "components.statusbar.clock"
-local wifi = require "components.statusbar.wifi"
-local battery = require "components.statusbar.battery"
-local brightness = require "components.statusbar.brightness"
-
-screen.connect_signal("request::desktop_decoration", function(s)
- local bar = awful.wibar({
- -- placement = function(d)
- -- local place = awful.placement.left + awful.placement.maximize_vertically
- -- return place(d, {
- -- margins = beautiful.useless_gap
- -- })
- -- end,
- margins = dpi(4),
- position = "left",
- screen = s,
- restrict_workarea = true,
- height = s.geometry.height - (beautiful.useless_gap * 4 + vars.border_width * 2) - 2,
- width = dpi(32),
- border_width = vars.border_width,
- border_color = vars.colors.bright.black,
- shape = vars.shape,
- bg = vars.colors.bg,
- widget = {
- {
- margins = dpi(4),
- widget = wibox.container.margin,
- {
- layout = wibox.layout.fixed.vertical,
- taglist
- }
- },
- nil,
- {
- margins = dpi(4),
- widget = wibox.container.margin,
- {
- layout = wibox.layout.fixed.vertical,
- spacing = dpi(8),
- brightness,
- battery,
- wifi,
- clock
- }
- },
- layout = wibox.layout.align.vertical,
- }
- })
-end)
diff --git a/.config/awesome/components/statusbar/taglist.lua b/.config/awesome/components/statusbar/taglist.lua
deleted file mode 100644
index 8eb8d17..0000000
--- a/.config/awesome/components/statusbar/taglist.lua
+++ /dev/null
@@ -1,86 +0,0 @@
-local awful = require "awful"
-local xresources = require "beautiful.xresources"
-local dpi = xresources.apply_dpi
-local vars = require "themes.prismite.vars"
-local wibox = require "wibox"
-local naughty = require "naughty"
-
-return awful.widget.taglist({
- screen = screen[1],
- filter = awful.widget.taglist.filter.all,
- style = {
- shape = vars.shape
- },
- layout = {
- spacing = 8,
- layout = wibox.layout.fixed.vertical
- },
- widget_template = {
- {
- {
- {
- id = "text_role",
- widget = wibox.widget.textbox,
- },
- widget = wibox.container.place,
- },
- {
- widget = wibox.container.background,
- bg = vars.colors.bright.black,
- shape = vars.shape,
- forced_height = dpi(2),
- forced_width = dpi(16),
- id = "indicator_role"
- },
- layout = wibox.layout.fixed.vertical
- },
- widget = wibox.container.place,
- create_callback = function(self, tag)
- local indicator = self:get_children_by_id("indicator_role")[1]
- local text = self:get_children_by_id("text_role")[1]
- -- naughty.notification {
- -- message = "b ".. tostring(text.font)
- -- }
-
- -- text.font = "FiraCode Nerd Font Mono SemiBold 12"
-
- -- naughty.notification {
- -- message = "a " .. tostring(text.font)
- -- }
-
- self:connect_signal("mouse::enter", function()
- if tag.selected then return end
-
- indicator.bg = vars.colors.yellow
- end)
-
- self:connect_signal("mouse::leave", function()
- if tag.selected then return end
-
- indicator.bg = vars.colors.bright.black
- end)
-
- if tag.selected then
- indicator.bg = vars.colors.yellow
- end
- end,
- update_callback = function(self, tag)
- local indicator = self:get_children_by_id("indicator_role")[1]
-
- if tag.selected then
- indicator.bg = vars.colors.yellow
- else
- indicator.bg = vars.colors.bright.black
- end
- end
- },
- buttons = {
- awful.button({ }, 1, function(t) t:view_only() end),
- awful.button({ modkey }, 1, function(t)
- if client.focus then
- client.focus:move_to_tag(t)
- end
- end),
- awful.button({ }, 3, awful.tag.viewtoggle),
- }
-})
diff --git a/.config/awesome/components/statusbar/wifi.lua b/.config/awesome/components/statusbar/wifi.lua
deleted file mode 100644
index e6431ce..0000000
--- a/.config/awesome/components/statusbar/wifi.lua
+++ /dev/null
@@ -1,60 +0,0 @@
-local awful = require "awful"
-local xresources = require "beautiful.xresources"
-local dpi = xresources.apply_dpi
-local vars = require "themes.prismite.vars"
-local wibox = require "wibox"
-
-local wifi_inner = awful.widget.watch("awk 'NR==3 {printf(\"%.0f\", $3*10/7)}' /proc/net/wireless", 1, function(widget, stdout)
- widget.font = "DejaVu Sans Mono wifi ramp Normal 8"
- local icon = ""
- local color = vars.colors.red
-
- if stdout == "" then
- widget:set_markup("<span color=\"" .. color .. "\">" .. icon .. "</span>")
- return
- end
-
- local percent = tonumber(stdout)
-
- if percent <= 20 then
- icon = ""
- color = vars.colors.red
- elseif percent <= 40 then
- icon = ""
- color = vars.colors.yellow
- elseif percent <= 60 then
- icon = ""
- color = vars.colors.yellow
- elseif percent <= 80 then
- icon = ""
- color = vars.colors.green
- elseif percent <= 100 then
- icon = ""
- color = vars.colors.green
- end
-
-
- widget:set_markup("<span color=\"" .. color .. "\">" .. icon .. "</span>")
-end)
-
-local wifi = wibox.widget {
- widget = wibox.container.place,
- wifi_inner
-}
-
-awful.tooltip {
- objects = { wifi },
- timer_function = function()
- return io.popen("iwgetid -r"):read("*a"):sub(0, -2)
- end,
- bg = vars.colors.bg,
- fg = vars.colors.fg,
- border_color = vars.colors.bright.black,
- border_width = vars.border_width,
- font = vars.font,
- shape = vars.shape,
- margin_leftright = dpi(6),
- margin_topbottom = dpi(6)
-}
-
-return wifi