2020-11-01 20:03:06 +01:00
|
|
|
local wibox = require("wibox")
|
|
|
|
local beautiful = require('beautiful')
|
|
|
|
|
2020-11-09 21:54:33 +01:00
|
|
|
local ICON_DIR = os.getenv("HOME") .. '/.config/awesome/awesome-wm-widgets/experiments/volume/icons/'
|
|
|
|
|
2020-11-01 20:03:06 +01:00
|
|
|
local widget = {}
|
|
|
|
|
|
|
|
function widget.get_widget()
|
|
|
|
|
|
|
|
return wibox.widget {
|
|
|
|
{
|
|
|
|
id = "icon",
|
2020-11-09 21:54:33 +01:00
|
|
|
image = ICON_DIR .. 'audio-volume-high-symbolic.svg',
|
2020-11-01 20:03:06 +01:00
|
|
|
resize = true,
|
|
|
|
widget = wibox.widget.imagebox,
|
|
|
|
},
|
|
|
|
max_value = 100,
|
|
|
|
thickness = 2,
|
|
|
|
start_angle = 4.71238898, -- 2pi*3/4
|
|
|
|
forced_height = 18,
|
|
|
|
forced_width = 18,
|
|
|
|
bg = '#ffffff11',
|
|
|
|
paddings = 2,
|
|
|
|
widget = wibox.container.arcchart,
|
|
|
|
set_volume_level = function(self, new_value)
|
|
|
|
self.value = new_value
|
|
|
|
end,
|
|
|
|
mute = function(self)
|
|
|
|
self.colors = {'#BF616A'}
|
|
|
|
end,
|
|
|
|
unmute = function(self)
|
|
|
|
self.colors = {beautiful.fg_color}
|
2020-11-09 16:53:07 +01:00
|
|
|
end
|
2020-11-01 20:03:06 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
return widget
|