Add microphone overlay desktop element

This commit is contained in:
elenapan 2020-09-27 00:47:04 +03:00
parent fdbc9a4403
commit 2e143eff4f
2 changed files with 42 additions and 0 deletions

View file

@ -0,0 +1,40 @@
local awful = require("awful")
local wibox = require("wibox")
local beautiful = require("beautiful")
local helpers = require("helpers")
local microphone_icon = ""
local muted_color = x.color8
local active_color = x.color1
local microphone_overlay = wibox({
bg = x.color0.."99",
width = dpi(60),
height = dpi(60),
visible = false,
ontop = true,
type = "dock",
input_passthrough = true,
shape = helpers.rrect(beautiful.border_radius),
})
awful.placement.bottom_right(microphone_overlay, { margins = beautiful.useless_gap * 2 })
local indicator = wibox.widget {
font = "icomoon 20",
align = "center",
valign = "center",
widget = wibox.widget.textbox(microphone_icon)
}
microphone_overlay:setup {
widget = indicator
}
awesome.connect_signal("evil::microphone", function(muted)
indicator.markup = helpers.colorize_text(microphone_icon, muted and muted_color or active_color)
end)
function microphone_overlay_toggle()
microphone_overlay.visible = not microphone_overlay.visible
end

View file

@ -228,6 +228,8 @@ lock_screen.init()
require("elemental.app_drawer")
-- Window switcher
require("elemental.window_switcher")
-- Toggle-able microphone overlay
require("elemental.microphone_overlay")
-- >> Daemons
-- Most widgets that display system/external info depend on evil.