Switch to Lain widgets

This commit is contained in:
Adam Cooper 2023-10-04 20:21:17 -04:00
parent 1c42660271
commit 53ec2790a2

View file

@ -13,8 +13,7 @@ local beautiful = require("beautiful")
-- Notification library
local naughty = require("naughty")
local menubar = require("menubar")
local cpu_widget = require("awesome-wm-widgets.cpu-widget.cpu-widget")
local ram_widget = require("awesome-wm-widgets.ram-widget.ram-widget")
local lain = require("lain")
local hotkeys_popup = require("awful.hotkeys_popup")
-- Enable hotkeys help widget for VIM and other apps
-- when client with a matching name is opened:
@ -177,6 +176,29 @@ end
-- Re-set wallpaper when a screen's geometry changes (e.g. different resolution)
screen.connect_signal("property::geometry", set_wallpaper)
local mymem = lain.widget.mem {
settings = function()
widget:set_markup(" mem " .. mem_now.perc)
end
}
local mycpu = lain.widget.cpu {
settings = function()
widget:set_markup(" cpu " .. cpu_now.usage)
end
}
local myweather = lain.widget.weather({
APPID = "f6497dd133dd22b541abc8bbe8360f3b",
city_id = 5110302,
units = 'imperial',
timeout = 20, -- remove this
settings = function()
units = math.floor(weather_now["main"]["temp"])
widget:set_markup(" " .. units .. " ")
end
})
awful.screen.connect_for_each_screen(function(s)
-- Wallpaper
set_wallpaper(s)
@ -223,13 +245,11 @@ awful.screen.connect_for_each_screen(function(s)
s.mytasklist, -- Middle widget
{ -- Right widgets
layout = wibox.layout.fixed.horizontal,
cpu_widget(),
ram_widget({
widget_height = 48,
widget_width = 48,
color_buf = beautiful.fg_normal,
}),
mycpu.widget,
mymem.widget,
wibox.widget.systray(),
myweather.icon,
myweather.widget,
mytextclock,
s.mylayoutbox,
},