Big rewrite part 1
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
-- Awesome Libs
|
||||
local aplacement = require('awful.placement')
|
||||
local apopup = require('awful.popup')
|
||||
local beautiful = require('beautiful')
|
||||
local dpi = require('beautiful').xresources.apply_dpi
|
||||
local gcolor = require('gears.color')
|
||||
local gfilesystem = require('gears.filesystem')
|
||||
@@ -44,61 +45,61 @@ function brightness_osd.new(args)
|
||||
{
|
||||
{ -- Brightness Icon
|
||||
{
|
||||
image = gcolor.recolor_image(icondir .. 'volume-off.svg', Theme_config.brightness_ods.icon_color),
|
||||
image = gcolor.recolor_image(icondir .. 'volume-off.svg', beautiful.colorscheme.bg_blue),
|
||||
valign = 'center',
|
||||
halign = 'center',
|
||||
resize = true,
|
||||
id = 'icon_role',
|
||||
widget = wibox.widget.imagebox
|
||||
widget = wibox.widget.imagebox,
|
||||
},
|
||||
widget = wibox.container.constraint,
|
||||
width = dpi(25),
|
||||
height = dpi(25),
|
||||
strategy = 'exact'
|
||||
strategy = 'exact',
|
||||
},
|
||||
{ -- Brightness Bar
|
||||
{
|
||||
{
|
||||
id = 'progressbar',
|
||||
color = Theme_config.brightness_ods.bar_bg_active,
|
||||
background_color = Theme_config.brightness_ods.bar_bg,
|
||||
color = beautiful.colorscheme.bg_blue,
|
||||
background_color = beautiful.colorscheme.bg,
|
||||
max_value = 100,
|
||||
value = 0,
|
||||
shape = gshape.rounded_rect,
|
||||
widget = wibox.widget.progressbar
|
||||
widget = wibox.widget.progressbar,
|
||||
},
|
||||
widget = wibox.container.constraint,
|
||||
width = dpi(250),
|
||||
height = dpi(5),
|
||||
},
|
||||
widget = wibox.container.place
|
||||
widget = wibox.container.place,
|
||||
},
|
||||
{ -- Brightness text
|
||||
widget = wibox.widget.textbox,
|
||||
id = 'text_role',
|
||||
text = '0',
|
||||
valign = 'center',
|
||||
halign = 'center'
|
||||
halign = 'center',
|
||||
},
|
||||
spacing = dpi(10),
|
||||
layout = wibox.layout.fixed.horizontal
|
||||
layout = wibox.layout.fixed.horizontal,
|
||||
},
|
||||
left = dpi(10),
|
||||
right = dpi(10),
|
||||
top = dpi(20),
|
||||
bottom = dpi(20),
|
||||
widget = wibox.container.margin
|
||||
widget = wibox.container.margin,
|
||||
},
|
||||
shape = Theme_config.brightness_ods.shape,
|
||||
widget = wibox.container.background
|
||||
shape = beautiful.shape[4],
|
||||
widget = wibox.container.background,
|
||||
},
|
||||
ontop = true,
|
||||
stretch = false,
|
||||
visible = false,
|
||||
border_color = Theme_config.brightness_ods.border_color,
|
||||
border_width = Theme_config.brightness_ods.border_width,
|
||||
fg = Theme_config.brightness_ods.fg,
|
||||
bg = Theme_config.brightness_ods.bg,
|
||||
border_color = beautiful.colorscheme.border_color,
|
||||
border_width = dpi(2),
|
||||
fg = beautiful.colorscheme.bg_blue,
|
||||
bg = beautiful.colorscheme.bg,
|
||||
screen = 1,
|
||||
placement = function(c) aplacement.bottom(c, { margins = dpi(20) }) end,
|
||||
}
|
||||
@@ -110,7 +111,7 @@ function brightness_osd.new(args)
|
||||
autostart = true,
|
||||
callback = function()
|
||||
w.visible = false
|
||||
end
|
||||
end,
|
||||
}
|
||||
|
||||
backlight_helper:connect_signal('brightness_changed', function()
|
||||
@@ -127,7 +128,7 @@ function brightness_osd.new(args)
|
||||
icon = icon .. '-high.svg'
|
||||
end
|
||||
|
||||
w.widget:get_children_by_id('icon')[1]:set_image(gcolor.recolor_image(icon, Theme_config.brightness_osd.icon_color))
|
||||
w.widget:get_children_by_id('icon')[1]:set_image(gcolor.recolor_image(icon, beautiful.colorscheme.bg_blue))
|
||||
w.widget:get_children_by_id('text_role')[1].text = brightness
|
||||
w:run()
|
||||
end)
|
||||
|
||||
Reference in New Issue
Block a user