52 lines
1 KiB
Lua
52 lines
1 KiB
Lua
#!/usr/bin/env lua
|
|
-- Generated by home-manager
|
|
local sbar = require("sbarlua")
|
|
|
|
-- Set variables
|
|
sbar.variables["COLOR"] = "0xff0000ff"
|
|
sbar.variables["FONT"] = "SF Pro"
|
|
sbar.variables["ITEMS"] = {
|
|
"calendar",
|
|
"cpu",
|
|
"memory"
|
|
}
|
|
sbar.variables["PADDING"] = 3
|
|
sbar.variables["SETTINGS"] = {
|
|
["enable_logging"] = true,
|
|
["refresh_freq"] = 1
|
|
}
|
|
|
|
-- Configure bar
|
|
sbar.bar:set({
|
|
["blur_radius"] = 20,
|
|
["corner_radius"] = 9,
|
|
["height"] = 30,
|
|
["padding_left"] = 10,
|
|
["padding_right"] = 10,
|
|
["position"] = "top"
|
|
})
|
|
|
|
-- Configure defaults
|
|
sbar.defaults:set({
|
|
["background.height"] = 24,
|
|
["icon.color"] = "$COLOR",
|
|
["icon.font"] = "$FONT",
|
|
["label.padding"] = "$PADDING",
|
|
["popup.background.border_width"] = 2,
|
|
["popup.background.corner_radius"] = 9
|
|
})
|
|
|
|
-- Extra configuration
|
|
-- This is a test Lua configuration
|
|
sbar:add("item", "cpu", {
|
|
position = "right",
|
|
update_freq = 1,
|
|
script = "./scripts/cpu.lua"
|
|
})
|
|
|
|
-- Subscribe to events
|
|
sbar:subscribe("cpu", "system_woke")
|
|
|
|
|
|
-- Update the bar
|
|
sbar:update()
|