added sketchybar config

This commit is contained in:
Tyler Mayoff 2025-02-14 09:59:25 -05:00
parent 87bb07f015
commit 95ebd7af03
No known key found for this signature in database
GPG key ID: B62A5AFAD8E14845
38 changed files with 2329 additions and 0 deletions

View file

@ -0,0 +1,69 @@
local icons = require("icons")
local colors = require("colors")
local settings = require("settings")
-- Execute the event provider binary which provides the event "cpu_update" for
-- the cpu load data, which is fired every 2.0 seconds.
sbar.exec("killall cpu_load >/dev/null; $CONFIG_DIR/helpers/event_providers/cpu_load/bin/cpu_load cpu_update 2.0")
local cpu = sbar.add("graph", "widgets.cpu" , 42, {
position = "right",
graph = { color = colors.blue },
background = {
height = 22,
color = { alpha = 0 },
border_color = { alpha = 0 },
drawing = true,
},
icon = { string = icons.cpu },
label = {
string = "cpu ??%",
font = {
family = settings.font.numbers,
style = settings.font.style_map["Bold"],
size = 9.0,
},
align = "right",
padding_right = 0,
width = 0,
y_offset = 4
},
padding_right = settings.paddings + 6
})
cpu:subscribe("cpu_update", function(env)
-- Also available: env.user_load, env.sys_load
local load = tonumber(env.total_load)
cpu:push({ load / 100. })
local color = colors.blue
if load > 30 then
if load < 60 then
color = colors.yellow
elseif load < 80 then
color = colors.orange
else
color = colors.red
end
end
cpu:set({
graph = { color = color },
label = "cpu " .. env.total_load .. "%",
})
end)
cpu:subscribe("mouse.clicked", function(env)
sbar.exec("open -a 'Activity Monitor'")
end)
-- Background around the cpu item
sbar.add("bracket", "widgets.cpu.bracket", { cpu.name }, {
background = { color = colors.bg1 }
})
-- Background around the cpu item
sbar.add("item", "widgets.cpu.padding", {
position = "right",
width = settings.group_paddings
})