nixos-config/modules/home-manager/ricing/awesomewm/dotfiles/signal/system/volume.lua
2024-07-12 18:19:30 +09:00

23 lines
523 B
Lua

local awful = require('awful')
local gears = require('gears')
local function volume_emit()
awful.spawn.easy_async_with_shell(
"bash -c 'pamixer --get-volume'", function(stdout)
local volume_int = tonumber(stdout) -- integer
awesome.emit_signal('signal::volume', volume_int) -- integer
end)
end
-- Microphone Fetching and Signal Emitting
-- Refreshing
-------------
gears.timer {
timeout = 1,
call_now = true,
autostart = true,
callback = function()
volume_emit()
end
}