1234567891011121314151617181920 |
- local wibox = require("wibox")
- local awful = require("awful")
- volume_widget = wibox.widget.textbox()
- volume_widget:set_align("right")
- function update_volume(widget)
- local cmd = "LANG=C pactl list sinks | awk '{if ($1 == \"Volume:\") print $5}'"
- local fd = io.popen(cmd)
- local status = fd:read("*l")
- fd:close()
- widget:set_markup("V: "..status)
- end
- update_volume(volume_widget)
- mytimer = timer({ timeout = 1 })
- mytimer:connect_signal("timeout", function () update_volume(volume_widget) end)
- mytimer:start()
|