Skip to content
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

feat volume: let all widgets read args for the icon_dir #375

Open
wants to merge 1 commit 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
12 changes: 5 additions & 7 deletions volume-widget/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,26 +60,24 @@ It is possible to customize the widget by providing a table with all or some of
| `step` | `5` | How much the volume is raised or lowered at once (in %) |
| `widget_type`| `icon_and_text`| Widget type, one of `horizontal_bar`, `vertical_bar`, `icon`, `icon_and_text`, `arc` |
| `device` | `pulse` | Select the device name to control |
| `icon_dir`| `./icons`| Path to the folder with icons |

Depends on the chosen widget type add parameters from the corresponding section below:

#### `icon` parameters

| Name | Default | Description |
|---|---|---|
| `icon_dir`| `./icons`| Path to the folder with icons |

_Note:_ if you are changing icons, the folder should contain following .svg images:
- audio-volume-high-symbolic
- audio-volume-medium-symbolic
- audio-volume-low-symbolic
- audio-volume-muted-symbolic

#### `icon` parameters

(None)

#### `icon_and_text` parameters

| Name | Default | Description |
|---|---|---|
| `icon_dir`| `./icons`| Path to the folder with icons |
| `font` | `beautiful.font` | Font name and size, like `Play 12` |

#### `arc` parameters
Expand Down
5 changes: 3 additions & 2 deletions volume-widget/widgets/arc-widget.lua
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,12 @@ function widget.get_widget(widgets_args)
local bg_color = args.bg_color or '#ffffff11'
local mute_color = args.mute_color or beautiful.fg_urgent
local size = args.size or 18
local icon_dir = args.icon_dir or ICON_DIR

return wibox.widget {
{
id = "icon",
image = ICON_DIR .. 'audio-volume-high-symbolic.svg',
image = icon_dir .. 'audio-volume-high-symbolic.svg',
resize = true,
widget = wibox.widget.imagebox,
},
Expand All @@ -43,4 +44,4 @@ function widget.get_widget(widgets_args)
end


return widget
return widget
3 changes: 2 additions & 1 deletion volume-widget/widgets/horizontal-bar-widget.lua
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,13 @@ function widget.get_widget(widgets_args)
local margins = args.margins or 10
local shape = args.shape or 'bar'
local with_icon = args.with_icon == true and true or false
local icon_dir = args.icon_dir or ICON_DIR

local bar = wibox.widget {
{
{
id = "icon",
image = ICON_DIR .. 'audio-volume-high-symbolic.svg',
image = icon_dir .. 'audio-volume-high-symbolic.svg',
resize = false,
widget = wibox.widget.imagebox,
},
Expand Down
3 changes: 2 additions & 1 deletion volume-widget/widgets/vertical-bar-widget.lua
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,13 @@ function widget.get_widget(widgets_args)
local margins = args.height or 2
local shape = args.shape or 'bar'
local with_icon = args.with_icon == true and true or false
local icon_dir = args.icon_dir or ICON_DIR

local bar = wibox.widget {
{
{
id = "icon",
image = ICON_DIR .. 'audio-volume-high-symbolic.svg',
image = icon_dir .. 'audio-volume-high-symbolic.svg',
resize = false,
widget = wibox.widget.imagebox,
},
Expand Down