added flash focus

This commit is contained in:
Gokul Swaminathan 2020-10-28 15:23:47 -07:00
parent 8aa94da85f
commit fdf2130012
2 changed files with 34 additions and 1 deletions

32
module/flash_focus.lua Normal file
View File

@ -0,0 +1,32 @@
local gears = require("gears")
local beautiful = require("beautiful")
local op = beautiful.flash_focus_start_opacity or 0.6
local stp = beautiful.flash_focus_step or 0.01
local flashfocus = function(c)
if c then
c.opacity = op
local q = op
local g = gears.timer {
timeout = stp,
call_now = false,
autostart = true
}
g:connect_signal("timeout", function()
if q >= 1 then
c.opacity = 1
g:stop()
else
c.opacity = q
q = q + stp
end
end)
end
end
local enable = function() client.connect_signal("focus", flashfocus) end
local disable = function() client.disconnect_signal("focus", flashfocus) end
return {enable = enable, disable = disable}

View File

@ -1,4 +1,5 @@
return {
window_swallowing = require("bling.module.window_swallowing"),
tiled_wallpaper = require("bling.module.tiled_wallpaper")
tiled_wallpaper = require("bling.module.tiled_wallpaper"),
flash_focus = require("bling.module.flash_focus")
}