Brightness widget - Use by default theme font

This commit is contained in:
Augusto Gunsch 2022-01-24 12:20:36 -03:00
parent ac49ade995
commit 779485872c
No known key found for this signature in database
GPG key ID: F7EEFE29825C72DC
2 changed files with 3 additions and 2 deletions

View file

@ -13,7 +13,7 @@ It is possible to customize widget by providing a table with all or some of the
| `step` | 5 | Step | | `step` | 5 | Step |
| `base` | 20 | Base level to set brightness to on left click. | | `base` | 20 | Base level to set brightness to on left click. |
| `path_to_icon` | `/usr/share/icons/Arc/status/symbolic/display-brightness-symbolic.svg` | Path to the icon | | `path_to_icon` | `/usr/share/icons/Arc/status/symbolic/display-brightness-symbolic.svg` | Path to the icon |
| `font` | `Play 9` | Font | | `font` | `beautiful.font` | Font name and size, like `Play 12` |
| `timeout` | 1 | How often in seconds the widget refreshes. Check the note below | | `timeout` | 1 | How often in seconds the widget refreshes. Check the note below |
| `tooltip` | false | Display brightness level in a tooltip when the mouse cursor hovers the widget | | `tooltip` | false | Display brightness level in a tooltip when the mouse cursor hovers the widget |

View file

@ -13,6 +13,7 @@ local wibox = require("wibox")
local watch = require("awful.widget.watch") local watch = require("awful.widget.watch")
local spawn = require("awful.spawn") local spawn = require("awful.spawn")
local naughty = require("naughty") local naughty = require("naughty")
local beautiful = require("beautiful")
local ICON_DIR = os.getenv("HOME") .. '/.config/awesome/awesome-wm-widgets/brightness-widget/' local ICON_DIR = os.getenv("HOME") .. '/.config/awesome/awesome-wm-widgets/brightness-widget/'
local get_brightness_cmd local get_brightness_cmd
@ -35,7 +36,7 @@ local function worker(user_args)
local type = args.type or 'arc' -- arc or icon_and_text local type = args.type or 'arc' -- arc or icon_and_text
local path_to_icon = args.path_to_icon or ICON_DIR .. 'brightness.svg' local path_to_icon = args.path_to_icon or ICON_DIR .. 'brightness.svg'
local font = args.font or 'Play 9' local font = args.font or beautiful.font
local timeout = args.timeout or 100 local timeout = args.timeout or 100
local program = args.program or 'light' local program = args.program or 'light'