I'd like to put a slider in each client's titlebar so it can control its opacity.
In official rc.lua, in the titlebar config we can find :
awful.titlebar.widget.floatingbutton (c)
so the client's id is sent to the widget
I thought of something like the code below :
local MAX = 1
local MIN = 0
--
-- le widget slider
opaciteControle = wibox.widget {
--forced_width = 100,
bar_shape = gears.shape.rounded_rect,
bar_height = 1,
bar_color = beautiful.border_color,
--handle_color = beautiful.bg_normal,
handle_color = "#FFFFFF",
handle_shape = gears.shape.circle,
handle_border_color = beautiful.border_color,
handle_border_width = 1,
minimum = MIN,
maximum = MAX,
value = .8,
widget = wibox.widget.slider,
}
-- le widget text
opaciteTexte = wibox.widget {
text = "opacite",
align = "center",
widget = wibox.widget.textbox,
}
-- le widget à afficher
opacite = wibox.widget {
opaciteTexte,
opaciteControle,
vertical_offset=5,
layout=wibox.layout.stack
}
-- actualisation
opaciteControle:connect_signal("widget::redraw_needed", function(c)
local v=opaciteControle.value
--
c.opacity=v
end)
and finally insert this widget in the titlebar's layout but this dosesn't work ; client's id doesn't seem to be properly pass to the function.
Thanks for helping me
David