Skip to content

Commit ce42deb

Browse files
authored
Merge pull request #468 from scattagain/master
Changed how shape is configured for the volume widget
2 parents 2a27e62 + 393cf22 commit ce42deb

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

volume-widget/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ _Note:_ if you are changing icons, the folder should contain following .svg imag
141141
| `bg_color` | `#ffffff11` | Color of the bar's background |
142142
| `width` | 50 | The bar width |
143143
| `margins` | 10 | Top and bottom margins (if your wibar is 22 px high, bar will be 2 px = 22 - 2*10) |
144-
| `shape` | `bar` | [gears.shape](https://awesomewm.org/doc/api/libraries/gears.shape.html), could be `octogon`, `hexagon`, `powerline`, etc |
144+
| `shape` | `gears.shape.bar` | A shape painter function (see [gears.shape](https://awesomewm.org/doc/api/libraries/gears.shape.html)) |
145145
| `with_icon` | true | Show volume icon|
146146

147147
_Note:_ I didn't figure out how does the `forced_height` property of progressbar widget work (maybe it doesn't work at all), thus there is a workaround with margins.
@@ -155,5 +155,5 @@ _Note:_ I didn't figure out how does the `forced_height` property of progressbar
155155
| `bg_color` | `#ffffff11` | Color of the bar's background |
156156
| `width` | 10 | The bar width |
157157
| `margins` | 20 | Top and bottom margins (if your wibar is 22 px high, bar will be 2 px = 22 - 2*10) |
158-
| `shape` | `bar` | [gears.shape](https://awesomewm.org/doc/api/libraries/gears.shape.html), could be `octogon`, `hexagon`, `powerline`, etc |
158+
| `shape` | `gears.shape.bar` | A shape painter function (see [gears.shape](https://awesomewm.org/doc/api/libraries/gears.shape.html)) |
159159
| `with_icon` | true | Show volume icon|

volume-widget/widgets/horizontal-bar-widget.lua

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ function widget.get_widget(widgets_args)
1414
local bg_color = args.bg_color or '#ffffff11'
1515
local width = args.width or 50
1616
local margins = args.margins or 10
17-
local shape = args.shape or 'bar'
17+
local shape = args.shape or gears.shape.bar
1818
local with_icon = args.with_icon == true and true or false
1919

2020
local bar = wibox.widget {
@@ -36,7 +36,8 @@ function widget.get_widget(widgets_args)
3636
color = main_color,
3737
margins = { top = margins, bottom = margins },
3838
background_color = bg_color,
39-
shape = gears.shape[shape],
39+
shape = shape,
40+
bar_shape = shape,
4041
widget = wibox.widget.progressbar,
4142
},
4243
spacing = 4,

volume-widget/widgets/vertical-bar-widget.lua

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ function widget.get_widget(widgets_args)
1414
local bg_color = args.bg_color or '#ffffff11'
1515
local width = args.width or 10
1616
local margins = args.height or 2
17-
local shape = args.shape or 'bar'
17+
local shape = args.shape or gears.shape.bar
1818
local with_icon = args.with_icon == true and true or false
1919

2020
local bar = wibox.widget {
@@ -38,7 +38,8 @@ function widget.get_widget(widgets_args)
3838
margins = { top = margins, bottom = margins },
3939
color = main_color,
4040
background_color = bg_color,
41-
shape = gears.shape[shape],
41+
shape = shape,
42+
bar_shape = shape,
4243
widget = wibox.widget.progressbar,
4344
},
4445
forced_width = width,

0 commit comments

Comments
 (0)