Added backlight popup
parent
e5b253411f
commit
40634f0de5
|
@ -1,6 +1,6 @@
|
||||||
-- Some subdir variables,
|
-- Some subdir variables,
|
||||||
-- to make switching icon sets easy.
|
-- to make switching icon sets easy.
|
||||||
local brightnessdir = conf_dir .. "assets/icons/brightness/clockwise/"
|
local brightnessdir = conf_dir .. "assets/icons/brightness/counterclockwise/"
|
||||||
local titlebardir = conf_dir .. "assets/icons/titlebar/"
|
local titlebardir = conf_dir .. "assets/icons/titlebar/"
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|
|
@ -19,9 +19,9 @@ function backlight
|
||||||
case "set"
|
case "set"
|
||||||
xbacklight -set $argv[2]
|
xbacklight -set $argv[2]
|
||||||
case "up"
|
case "up"
|
||||||
xbacklight -inc 10
|
xbacklight -inc $argv[2]
|
||||||
case "down"
|
case "down"
|
||||||
xbacklight -dec 10
|
xbacklight -dec $argv[2]
|
||||||
case "*"
|
case "*"
|
||||||
echo "Unknown function \"$argv[1]\""
|
echo "Unknown function \"$argv[1]\""
|
||||||
echo ""
|
echo ""
|
||||||
|
|
|
@ -1,4 +1,14 @@
|
||||||
|
local popup = require("modules.backlight.popup")
|
||||||
|
|
||||||
return {
|
return {
|
||||||
widget = require("modules.backlight.widget").widget,
|
widget = require("modules.backlight.widget").widget,
|
||||||
keybinds = require("modules.backlight.keybinds"),
|
keybinds = require("modules.backlight.keybinds"),
|
||||||
|
|
||||||
|
init = function()
|
||||||
|
awesome.emit_signal("modules::backlight:update_read")
|
||||||
|
end,
|
||||||
|
|
||||||
|
for_each_screen = function (s)
|
||||||
|
popup(s)
|
||||||
|
end
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,8 @@ local backlight = req_rel(..., "util")
|
||||||
return gears.table.join(
|
return gears.table.join(
|
||||||
awful.key( {}, "XF86MonBrightnessUp",
|
awful.key( {}, "XF86MonBrightnessUp",
|
||||||
function ()
|
function ()
|
||||||
backlight.backlight_up()
|
backlight.backlight_up(config.backlight.button_step)
|
||||||
|
awesome.emit_signal("module::backlight:popup_show")
|
||||||
end,
|
end,
|
||||||
{
|
{
|
||||||
description = "Raise brightness",
|
description = "Raise brightness",
|
||||||
|
@ -13,7 +14,8 @@ return gears.table.join(
|
||||||
|
|
||||||
awful.key( {}, "XF86MonBrightnessDown",
|
awful.key( {}, "XF86MonBrightnessDown",
|
||||||
function ()
|
function ()
|
||||||
backlight.backlight_down()
|
backlight.backlight_down(config.backlight.button_step)
|
||||||
|
awesome.emit_signal("module::backlight:popup_show")
|
||||||
end,
|
end,
|
||||||
{
|
{
|
||||||
description = "Lower brightness",
|
description = "Lower brightness",
|
||||||
|
|
|
@ -0,0 +1,242 @@
|
||||||
|
local backlight = req_rel(..., "util")
|
||||||
|
|
||||||
|
return function(s)
|
||||||
|
local widget = wibox.widget {
|
||||||
|
{
|
||||||
|
{
|
||||||
|
{
|
||||||
|
{ -- Icon and margins
|
||||||
|
nil,
|
||||||
|
{
|
||||||
|
nil,
|
||||||
|
{
|
||||||
|
id = "icon",
|
||||||
|
forced_height = beautiful.dpi(100),
|
||||||
|
image = beautiful.icons.brightness.i,
|
||||||
|
widget = wibox.widget.imagebox
|
||||||
|
},
|
||||||
|
nil,
|
||||||
|
expand = "none",
|
||||||
|
id = "icon_margin2",
|
||||||
|
layout = wibox.layout.align.vertical
|
||||||
|
},
|
||||||
|
nil,
|
||||||
|
id = "icon_margin1",
|
||||||
|
expand = "none",
|
||||||
|
layout = wibox.layout.align.horizontal
|
||||||
|
},
|
||||||
|
{ -- Text and percentage
|
||||||
|
{
|
||||||
|
id = "label",
|
||||||
|
text = "Backlight",
|
||||||
|
align = "left",
|
||||||
|
valign = "center",
|
||||||
|
widget = wibox.widget.textbox
|
||||||
|
},
|
||||||
|
nil,
|
||||||
|
{
|
||||||
|
id = "value",
|
||||||
|
text = "0%",
|
||||||
|
align = "center",
|
||||||
|
valign = "center",
|
||||||
|
widget = wibox.widget.textbox
|
||||||
|
},
|
||||||
|
id = "label_value_layout",
|
||||||
|
forced_height = beautiful.dpi(48),
|
||||||
|
layout = wibox.layout.align.horizontal,
|
||||||
|
},
|
||||||
|
{ -- Progress bar
|
||||||
|
{
|
||||||
|
id = "backlight_bar",
|
||||||
|
shape = gears.shape.rounded_bar,
|
||||||
|
forced_height = beautiful.dpi(10),
|
||||||
|
background_color = "#AAAAAA88",
|
||||||
|
bar_color = "#ffffff",
|
||||||
|
color = "#ffffff",
|
||||||
|
bar_shape = gears.shape.rounded_bar,
|
||||||
|
max_value = 100,
|
||||||
|
widget = wibox.widget.progressbar
|
||||||
|
},
|
||||||
|
id = "bar_layout",
|
||||||
|
forced_height = beautiful.dpi(24),
|
||||||
|
widget = wibox.container.place
|
||||||
|
},
|
||||||
|
id = "icon_bar_layout",
|
||||||
|
spacing = beautiful.dpi(0),
|
||||||
|
layout = wibox.layout.align.vertical
|
||||||
|
},
|
||||||
|
id = "popup_layout",
|
||||||
|
layout = wibox.layout.align.vertical,
|
||||||
|
},
|
||||||
|
id = "container",
|
||||||
|
left = beautiful.dpi(20),
|
||||||
|
right = beautiful.dpi(20),
|
||||||
|
top = beautiful.dpi(10),
|
||||||
|
bottom = beautiful.dpi(10),
|
||||||
|
widget = wibox.container.margin
|
||||||
|
},
|
||||||
|
bg ="#000000CC",
|
||||||
|
widget = wibox.container.background,
|
||||||
|
ontop = true,
|
||||||
|
visible = true,
|
||||||
|
type = "notification",
|
||||||
|
forced_height = beautiful.dpi(180),
|
||||||
|
forced_width = beautiful.dpi(300),
|
||||||
|
offset = beautiful.dpi(5),
|
||||||
|
}
|
||||||
|
|
||||||
|
local popup_container = awful.popup {
|
||||||
|
widget = wibox.container.background,
|
||||||
|
ontop = true,
|
||||||
|
bg = "#00000000",
|
||||||
|
stretch = false,
|
||||||
|
visible = false,
|
||||||
|
screen = s,
|
||||||
|
|
||||||
|
placement = function(c)
|
||||||
|
awful.placement.bottom_right(
|
||||||
|
c,
|
||||||
|
{
|
||||||
|
honor_workarea = true,
|
||||||
|
margins = {
|
||||||
|
top = beautiful.dpi(200)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)
|
||||||
|
end,
|
||||||
|
|
||||||
|
-- Only set corner radius here.
|
||||||
|
shape = function(cr, width, height)
|
||||||
|
gears.shape.partially_rounded_rect(
|
||||||
|
cr,
|
||||||
|
width,
|
||||||
|
height,
|
||||||
|
true,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
beautiful.dpi(20)
|
||||||
|
)
|
||||||
|
end
|
||||||
|
}
|
||||||
|
|
||||||
|
popup_container:setup {
|
||||||
|
widget,
|
||||||
|
layout = wibox.layout.fixed.horizontal
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
awesome.connect_signal("module::backlight:update",
|
||||||
|
function(value)
|
||||||
|
|
||||||
|
-- Update slider
|
||||||
|
widget.
|
||||||
|
container.
|
||||||
|
popup_layout.
|
||||||
|
icon_bar_layout.
|
||||||
|
bar_layout.
|
||||||
|
backlight_bar:set_value(value)
|
||||||
|
|
||||||
|
-- Update text
|
||||||
|
widget.
|
||||||
|
container.
|
||||||
|
popup_layout.
|
||||||
|
icon_bar_layout.
|
||||||
|
label_value_layout.
|
||||||
|
value:set_text(value .. "%")
|
||||||
|
|
||||||
|
-- Update icon
|
||||||
|
local icon
|
||||||
|
if value >= 90 then icon = beautiful.icons.brightness.i
|
||||||
|
elseif value >= 80 then icon = beautiful.icons.brightness.h
|
||||||
|
elseif value >= 70 then icon = beautiful.icons.brightness.g
|
||||||
|
elseif value >= 60 then icon = beautiful.icons.brightness.f
|
||||||
|
elseif value >= 50 then icon = beautiful.icons.brightness.e
|
||||||
|
elseif value >= 40 then icon = beautiful.icons.brightness.d
|
||||||
|
elseif value >= 30 then icon = beautiful.icons.brightness.c
|
||||||
|
elseif value >= 20 then icon = beautiful.icons.brightness.b
|
||||||
|
elseif value <= 10 then icon = beautiful.icons.brightness.a end
|
||||||
|
|
||||||
|
widget.
|
||||||
|
container.
|
||||||
|
popup_layout.
|
||||||
|
icon_bar_layout.
|
||||||
|
icon_margin1.
|
||||||
|
icon_margin2.
|
||||||
|
icon:set_image(icon)
|
||||||
|
end
|
||||||
|
)
|
||||||
|
|
||||||
|
local hide_popup_timer = gears.timer {
|
||||||
|
timeout = 1,
|
||||||
|
autostart = true,
|
||||||
|
callback = function()
|
||||||
|
popup_container.visible = false
|
||||||
|
end
|
||||||
|
}
|
||||||
|
|
||||||
|
awesome.connect_signal("module::all:popup_hide",
|
||||||
|
function(except)
|
||||||
|
if (except == "backlight") then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
popup_container.visible = false
|
||||||
|
if hide_popup_timer.started then
|
||||||
|
hide_popup_timer:stop()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
awesome.connect_signal("module::backlight:popup_show",
|
||||||
|
function()
|
||||||
|
awesome.emit_signal("module::all:popup_hide", "backlight")
|
||||||
|
if s == mouse.screen then
|
||||||
|
popup_container.visible = true
|
||||||
|
end
|
||||||
|
|
||||||
|
if hide_popup_timer.started then
|
||||||
|
hide_popup_timer:again()
|
||||||
|
else
|
||||||
|
hide_popup_timer:start()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
)
|
||||||
|
|
||||||
|
awesome.connect_signal("module::backlight:popup_show_stay",
|
||||||
|
function()
|
||||||
|
awesome.emit_signal("module::all:popup_hide", "backlight")
|
||||||
|
if s == mouse.screen then
|
||||||
|
popup_container.visible = true
|
||||||
|
end
|
||||||
|
|
||||||
|
if hide_popup_timer.started then
|
||||||
|
hide_popup_timer:stop()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
popup_container:connect_signal("button::press",
|
||||||
|
function(_, _, _, button, mods)
|
||||||
|
-- Scroll up
|
||||||
|
if (button == 4) then
|
||||||
|
backlight.backlight_up(config.backlight.scroll_step)
|
||||||
|
|
||||||
|
-- Scroll down
|
||||||
|
elseif (button == 5) then
|
||||||
|
backlight.backlight_down(config.backlight.scroll_step)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
)
|
||||||
|
|
||||||
|
popup_container:connect_signal("mouse::enter", function(result)
|
||||||
|
awesome.emit_signal("module::backlight:popup_show_stay")
|
||||||
|
end)
|
||||||
|
|
||||||
|
popup_container:connect_signal("mouse::leave", function(result)
|
||||||
|
awesome.emit_signal("module::backlight:popup_show")
|
||||||
|
end)
|
||||||
|
|
||||||
|
end
|
||||||
|
|
|
@ -4,20 +4,8 @@ local backlight = {}
|
||||||
local script = conf_dir .. "modules/backlight/backlight.fish"
|
local script = conf_dir .. "modules/backlight/backlight.fish"
|
||||||
script = script .. " "
|
script = script .. " "
|
||||||
|
|
||||||
backlight.hooks = {}
|
|
||||||
backlight.add_hook = function(callback)
|
|
||||||
backlight.hooks[#backlight.hooks + 1] = callback
|
|
||||||
end
|
|
||||||
|
|
||||||
backlight.exec_hooks = function()
|
backlight.get = function(callback)
|
||||||
backlight.read(function(status)
|
|
||||||
for i=1, #backlight.hooks do
|
|
||||||
backlight.hooks[i](status)
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
end
|
|
||||||
|
|
||||||
backlight.read = function(callback)
|
|
||||||
awful.spawn.easy_async(
|
awful.spawn.easy_async(
|
||||||
script .. "get",
|
script .. "get",
|
||||||
function(stdout, stderr, exitreason, exitcode)
|
function(stdout, stderr, exitreason, exitcode)
|
||||||
|
@ -40,25 +28,36 @@ backlight.watch = function(timeout, callback, widget)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
backlight.backlight_up = function()
|
backlight.backlight_up = function(value)
|
||||||
awful.spawn(script .. "up", false)
|
awful.spawn.easy_async(
|
||||||
backlight.exec_hooks()
|
script .. "up " .. value,
|
||||||
|
function(stdout, stderr, exitreason, exitcode)
|
||||||
|
awesome.emit_signal("module::backlight:update_read")
|
||||||
|
end
|
||||||
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
backlight.backlight_down = function()
|
backlight.backlight_down = function(value)
|
||||||
awful.spawn(script .. "down", false)
|
awful.spawn.easy_async(
|
||||||
backlight.exec_hooks()
|
script .. "down " .. value,
|
||||||
|
function(stdout, stderr, exitreason, exitcode)
|
||||||
|
awesome.emit_signal("module::backlight:update_read")
|
||||||
|
end
|
||||||
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
--[[
|
awesome.connect_signal("module::backlight:update_read",
|
||||||
backlight.redshift = function(temp)
|
function()
|
||||||
awful.spawn("redshift -O " .. tostring(temp), false)
|
backlight.get(
|
||||||
|
function(value)
|
||||||
|
awesome.emit_signal(
|
||||||
|
"module::backlight:update",
|
||||||
|
value
|
||||||
|
)
|
||||||
end
|
end
|
||||||
|
)
|
||||||
backlight.reset_redshift = function()
|
|
||||||
awful.spawn("redshift -x", false)
|
|
||||||
end
|
end
|
||||||
--]]
|
)
|
||||||
|
|
||||||
|
|
||||||
return backlight
|
return backlight
|
||||||
|
|
|
@ -53,47 +53,47 @@ widget.widget = wibox.widget {
|
||||||
|
|
||||||
widget.widget:connect_signal("mouse::enter", function(result)
|
widget.widget:connect_signal("mouse::enter", function(result)
|
||||||
widget.widget.bg = beautiful.color.bar.hover_bg
|
widget.widget.bg = beautiful.color.bar.hover_bg
|
||||||
|
awesome.emit_signal("module::backlight:popup_show_stay")
|
||||||
end)
|
end)
|
||||||
|
|
||||||
widget.widget:connect_signal("mouse::leave", function(result)
|
widget.widget:connect_signal("mouse::leave", function(result)
|
||||||
widget.widget.bg = beautiful.color.transparent
|
widget.widget.bg = beautiful.color.transparent
|
||||||
|
awesome.emit_signal("module::backlight:popup_show")
|
||||||
end)
|
end)
|
||||||
|
|
||||||
widget.widget:connect_signal("button::press",
|
widget.widget:connect_signal("button::press",
|
||||||
function(_, _, _, button, mods)
|
function(_, _, _, button, mods)
|
||||||
-- Scroll up
|
-- Scroll up
|
||||||
if (button == 4) then
|
if (button == 4) then
|
||||||
backlight.backlight_up()
|
backlight.backlight_up(config.backlight.scroll_step)
|
||||||
-- Scroll down
|
-- Scroll down
|
||||||
elseif (button == 5) then
|
elseif (button == 5) then
|
||||||
backlight.backlight_down()
|
backlight.backlight_down(config.backlight.scroll_step)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
)
|
)
|
||||||
|
|
||||||
widget.update = function(value)
|
awesome.connect_signal("module::backlight:update",
|
||||||
|
function(value)
|
||||||
widget.arc.value = value
|
widget.arc.value = value
|
||||||
|
|
||||||
--[[if value > 90 then widget.icon.image = beautiful.icons.brightness.i
|
if value >= 90 then widget.icon.image = beautiful.icons.brightness.i
|
||||||
elseif value > 80 then widget.icon.image = beautiful.icons.brightness.h
|
elseif value >= 80 then widget.icon.image = beautiful.icons.brightness.h
|
||||||
elseif value > 70 then widget.icon.image = beautiful.icons.brightness.g
|
elseif value >= 70 then widget.icon.image = beautiful.icons.brightness.g
|
||||||
elseif value > 60 then widget.icon.image = beautiful.icons.brightness.f
|
elseif value >= 60 then widget.icon.image = beautiful.icons.brightness.f
|
||||||
elseif value > 50 then widget.icon.image = beautiful.icons.brightness.e
|
elseif value >= 50 then widget.icon.image = beautiful.icons.brightness.e
|
||||||
elseif value > 40 then widget.icon.image = beautiful.icons.brightness.d
|
elseif value >= 40 then widget.icon.image = beautiful.icons.brightness.d
|
||||||
elseif value > 30 then widget.icon.image = beautiful.icons.brightness.c
|
elseif value >= 30 then widget.icon.image = beautiful.icons.brightness.c
|
||||||
elseif value > 20 then widget.icon.image = beautiful.icons.brightness.b
|
elseif value >= 20 then widget.icon.image = beautiful.icons.brightness.b
|
||||||
elseif value <= 10 then widget.icon.image = beautiful.icons.brightness.a end
|
elseif value <= 10 then widget.icon.image = beautiful.icons.brightness.a end
|
||||||
--]]
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
backlight.add_hook(widget.update)
|
|
||||||
backlight.watch(
|
backlight.watch(
|
||||||
5,
|
5,
|
||||||
function()
|
function()
|
||||||
backlight.read(widget.update)
|
awesome.emit_signal("module::backlight::update_read")
|
||||||
end,
|
end,
|
||||||
widget.widget
|
widget.widget
|
||||||
)
|
)
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
local volume = require("modules.volume.util")
|
local volume = require("modules.volume.util")
|
||||||
local widget = require("modules.volume.widget")
|
|
||||||
local popup = require("modules.volume.popup")
|
local popup = require("modules.volume.popup")
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|
|
@ -4,7 +4,7 @@ return gears.table.join(
|
||||||
awful.key( {}, "XF86AudioRaiseVolume",
|
awful.key( {}, "XF86AudioRaiseVolume",
|
||||||
function ()
|
function ()
|
||||||
volume.volume_up(config.volume.button_step)
|
volume.volume_up(config.volume.button_step)
|
||||||
awesome.emit_signal("module::volume_popup:show")
|
awesome.emit_signal("module::volume:popup_show")
|
||||||
end,
|
end,
|
||||||
{
|
{
|
||||||
description = "Volume up",
|
description = "Volume up",
|
||||||
|
@ -15,7 +15,7 @@ return gears.table.join(
|
||||||
awful.key( {}, "XF86AudioLowerVolume",
|
awful.key( {}, "XF86AudioLowerVolume",
|
||||||
function ()
|
function ()
|
||||||
volume.volume_down(config.volume.button_step)
|
volume.volume_down(config.volume.button_step)
|
||||||
awesome.emit_signal("module::volume_popup:show")
|
awesome.emit_signal("module::volume:popup_show")
|
||||||
end,
|
end,
|
||||||
{
|
{
|
||||||
description = "Volume down",
|
description = "Volume down",
|
||||||
|
@ -26,7 +26,7 @@ return gears.table.join(
|
||||||
awful.key( {}, "XF86AudioMute",
|
awful.key( {}, "XF86AudioMute",
|
||||||
function ()
|
function ()
|
||||||
volume.toggle_mute()
|
volume.toggle_mute()
|
||||||
awesome.emit_signal("module::volume_popup:show")
|
awesome.emit_signal("module::volume:popup_show")
|
||||||
end,
|
end,
|
||||||
{
|
{
|
||||||
description = "Mute",
|
description = "Mute",
|
||||||
|
|
|
@ -125,6 +125,26 @@ return function(s)
|
||||||
layout = wibox.layout.fixed.horizontal
|
layout = wibox.layout.fixed.horizontal
|
||||||
}
|
}
|
||||||
|
|
||||||
|
local hide_popup_timer = gears.timer {
|
||||||
|
timeout = 1,
|
||||||
|
autostart = true,
|
||||||
|
callback = function()
|
||||||
|
popup_container.visible = false
|
||||||
|
end
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
awesome.connect_signal("module::all:popup_hide",
|
||||||
|
function(except)
|
||||||
|
if (except == "volume") then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
popup_container.visible = false
|
||||||
|
if hide_popup_timer.started then
|
||||||
|
hide_popup_timer:stop()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
)
|
||||||
|
|
||||||
awesome.connect_signal("module::volume:update",
|
awesome.connect_signal("module::volume:update",
|
||||||
function(status)
|
function(status)
|
||||||
|
@ -169,17 +189,9 @@ return function(s)
|
||||||
end
|
end
|
||||||
)
|
)
|
||||||
|
|
||||||
local hide_popup_timer = gears.timer {
|
awesome.connect_signal("module::volume:popup_show",
|
||||||
timeout = 1,
|
|
||||||
autostart = true,
|
|
||||||
callback = function()
|
|
||||||
popup_container.visible = false
|
|
||||||
end
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
awesome.connect_signal("module::volume_popup:show",
|
|
||||||
function()
|
function()
|
||||||
|
awesome.emit_signal("module::all:popup_hide", "volume")
|
||||||
if s == mouse.screen then
|
if s == mouse.screen then
|
||||||
popup_container.visible = true
|
popup_container.visible = true
|
||||||
end
|
end
|
||||||
|
@ -192,8 +204,9 @@ return function(s)
|
||||||
end
|
end
|
||||||
)
|
)
|
||||||
|
|
||||||
awesome.connect_signal("module::volume_popup:show_stay",
|
awesome.connect_signal("module::volume:popup_show_stay",
|
||||||
function()
|
function()
|
||||||
|
awesome.emit_signal("module::all:popup_hide", "volume")
|
||||||
if s == mouse.screen then
|
if s == mouse.screen then
|
||||||
popup_container.visible = true
|
popup_container.visible = true
|
||||||
end
|
end
|
||||||
|
@ -207,7 +220,7 @@ return function(s)
|
||||||
|
|
||||||
popup_container:connect_signal("button::press",
|
popup_container:connect_signal("button::press",
|
||||||
function(_, _, _, button, mods)
|
function(_, _, _, button, mods)
|
||||||
-- Right-click
|
-- Left-click
|
||||||
if (button == 1) then
|
if (button == 1) then
|
||||||
volume.toggle_mute()
|
volume.toggle_mute()
|
||||||
|
|
||||||
|
@ -223,11 +236,11 @@ return function(s)
|
||||||
)
|
)
|
||||||
|
|
||||||
popup_container:connect_signal("mouse::enter", function(result)
|
popup_container:connect_signal("mouse::enter", function(result)
|
||||||
awesome.emit_signal("module::volume_popup:show_stay")
|
awesome.emit_signal("module::volume:popup_show_stay")
|
||||||
end)
|
end)
|
||||||
|
|
||||||
popup_container:connect_signal("mouse::leave", function(result)
|
popup_container:connect_signal("mouse::leave", function(result)
|
||||||
awesome.emit_signal("module::volume_popup:show")
|
awesome.emit_signal("module::volume:popup_show")
|
||||||
end)
|
end)
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -70,19 +70,19 @@ widget.widget = wibox.widget {
|
||||||
|
|
||||||
widget.widget:connect_signal("mouse::enter", function(result)
|
widget.widget:connect_signal("mouse::enter", function(result)
|
||||||
widget.widget.bg = beautiful.color.bar.hover_bg
|
widget.widget.bg = beautiful.color.bar.hover_bg
|
||||||
awesome.emit_signal("module::volume_popup:show_stay")
|
awesome.emit_signal("module::volume:popup_show_stay")
|
||||||
end)
|
end)
|
||||||
|
|
||||||
widget.widget:connect_signal("mouse::leave", function(result)
|
widget.widget:connect_signal("mouse::leave", function(result)
|
||||||
widget.widget.bg = beautiful.color.transparent
|
widget.widget.bg = beautiful.color.transparent
|
||||||
awesome.emit_signal("module::volume_popup:show")
|
awesome.emit_signal("module::volume:popup_show")
|
||||||
end)
|
end)
|
||||||
|
|
||||||
widget.widget:connect_signal("button::press",
|
widget.widget:connect_signal("button::press",
|
||||||
function(_, _, _, button, mods)
|
function(_, _, _, button, mods)
|
||||||
|
|
||||||
-- Right-click
|
-- Left-click
|
||||||
if (button == 3) then
|
if (button == 1) then
|
||||||
volume.toggle_mute()
|
volume.toggle_mute()
|
||||||
|
|
||||||
-- Scroll up
|
-- Scroll up
|
||||||
|
@ -93,7 +93,7 @@ widget.widget:connect_signal("button::press",
|
||||||
elseif (button == 5) then
|
elseif (button == 5) then
|
||||||
volume.volume_down(config.volume.scroll_step)
|
volume.volume_down(config.volume.scroll_step)
|
||||||
end
|
end
|
||||||
awesome.emit_signal("module::volume_popup:update")
|
awesome.emit_signal("module::volume:popup_update")
|
||||||
end
|
end
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue