2021-02-17 07:01:29 +01:00
## 🔦 Flash Focus <!-- {docsify-ignore} -->
2023-01-28 15:27:21 +01:00
Flash focus creates an opacity flash animation when a client is focused.
2021-02-17 07:01:29 +01:00
### Usage
There are two ways in which you can use this module. You can enable it by calling the `enable()` function:
```lua
bling.module.flash_focus.enable()
```
2023-01-28 15:27:21 +01:00
This connects to the focus signal of a client, which means that the flash focus will activate with whatever method you use to focus the client.
2021-02-17 07:01:29 +01:00
The other way is to call the function itself like this: `bling.module.flash_focus.flashfocus(someclient)` . This allows you to activate on certain keybinds like so:
```lua
awful.key({modkey}, "Up",
2021-04-28 13:25:20 +02:00
function()
2021-02-17 07:01:29 +01:00
awful.client.focus.bydirection("up")
bling.module.flash_focus.flashfocus(client.focus)
end, {description = "focus up", group = "client"})
```
### Theme Variables
```lua
2021-10-13 17:26:04 +02:00
theme.flash_focus_start_opacity = 0.6 -- the starting opacity
theme.flash_focus_step = 0.01 -- the step of animation
2021-02-17 07:01:29 +01:00
```
### Preview
![](https://imgur.com/5txYrlV.gif)
*gif by [JavaCafe01 ](https://github.com/JavaCafe01 )*