Skip to content

feat(brightness-widget): add size and arc_thickness options #471

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions brightness-widget/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ It is possible to customize widget by providing a table with all or some of the
| `tooltip` | false | Display brightness level in a tooltip when the mouse cursor hovers the widget |
| `percentage` | false | Display a '%' character after the brightness level |
| `rmb_set_max` | false | Right mouse click sets the brightness level to maximum |
| `size` | 18 | Size of the widget (used only for `arc` type) |
| `arc_thickness` | 2 | Thickness of the arc (used only for `arc` type) |

_Note:_ If brightness is controlled only by the widget (either by a mouse, or by a shortcut, then the `timeout` could be quite big, as there is no reason to synchronize the brightness level).

Expand Down
8 changes: 5 additions & 3 deletions brightness-widget/brightness.lua
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ local function worker(user_args)
local path_to_icon = args.path_to_icon or ICON_DIR .. 'brightness.svg'
local font = args.font or beautiful.font
local timeout = args.timeout or 100
local size = args.size or 18
local arc_thickness = args.arc_thickness or 2

local program = args.program or 'light'
local step = args.step or 5
Expand Down Expand Up @@ -105,10 +107,10 @@ local function worker(user_args)
layout = wibox.container.place
},
max_value = 100,
thickness = 2,
thickness = arc_thickness,
start_angle = 4.71238898, -- 2pi*3/4
forced_height = 18,
forced_width = 18,
forced_height = size,
forced_width = size,
paddings = 2,
widget = wibox.container.arcchart,
set_value = function(self, level)
Expand Down