Files
dotfiles/.config/luastatus/alsa.lua
T
venomade 4b8cc0b9a9 ZK, NVIM and Misc
Add ZK config, template and script.
Add various Neovim plugins, and some markdown specific settings.
Add Neovim aliases.
Fix 100% in alsa luastatus plugin.
2026-02-13 18:09:22 +00:00

34 lines
851 B
Lua

widget = {
plugin = 'alsa',
cb = function(t)
local symbol = '󰖀'
if t.mute then
return { full_text = ' 󰝟 ', color = '#ed8796' }
else
local percent = (t.vol.cur - t.vol.min) / (t.vol.max - t.vol.min) * 100
if percent <= 30 then
symbol = '󰕿'
elseif percent >= 70 then
symbol = '󰕾'
if percent >= 99.5 then
return {
full_text = string.format('%s %d%%', symbol, math.floor(0.5 + percent)),
color = '#b7bdf8'
}
end
end
return {
full_text = string.format('%s%3d%%', symbol, math.floor(0.5 + percent)),
color = '#b7bdf8'
}
end
end,
event = [[
local t = ...
if t.button == 1 then
os.execute('pactl set-sink-mute @DEFAULT_SINK@ toggle &')
end
]],
}