update volumearc readme
This commit is contained in:
parent
94f818ac1a
commit
93ef029bdb
|
@ -4,6 +4,24 @@ Almost the same as [volumebar widget](https://github.com/streetturtle/awesome-wm
|
||||||
|
|
||||||
![screenshot]({{'/assets/img/screenshots/volumearc-widget.gif' | relative_url }}){:.center-image}
|
![screenshot]({{'/assets/img/screenshots/volumearc-widget.gif' | relative_url }}){:.center-image}
|
||||||
|
|
||||||
|
## Customization
|
||||||
|
|
||||||
|
It is possible to customize widget by providing a table with all or some of the following config parameters:
|
||||||
|
|
||||||
|
```lua
|
||||||
|
volumearc_widget({
|
||||||
|
main_color = '#af13f7',
|
||||||
|
mute_color = '#ff0000',
|
||||||
|
path_to_icon = '/usr/share/icons/Papirus-Dark/symbolic/status/audio-volume-high-symbolic.svg',
|
||||||
|
thickness = 5,
|
||||||
|
height = 25
|
||||||
|
})
|
||||||
|
```
|
||||||
|
|
||||||
|
Above config results in following widget:
|
||||||
|
|
||||||
|
![custom](./custom.png)
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
1. Clone this repo under **~/.config/awesome/**
|
1. Clone this repo under **~/.config/awesome/**
|
||||||
|
@ -29,9 +47,9 @@ Almost the same as [volumebar widget](https://github.com/streetturtle/awesome-wm
|
||||||
volumearc_widget(),
|
volumearc_widget(),
|
||||||
--[[or customized]]
|
--[[or customized]]
|
||||||
volumearc_widget({
|
volumearc_widget({
|
||||||
main_color = '#0000ff',
|
main_color = '#af13f7',
|
||||||
mute_color = '#ff0000',
|
mute_color = '#ff0000',
|
||||||
path_to_icon = '/usr/share/icons/Arc/actions/symbolic/view-grid-symbolic.svg',
|
path_to_icon = '/usr/share/icons/Papirus-Dark/symbolic/status/audio-volume-high-symbolic.svg',
|
||||||
thickness = 5,
|
thickness = 5,
|
||||||
height = 25
|
height = 25
|
||||||
}),
|
}),
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 9.2 KiB |
|
@ -59,8 +59,8 @@ local function worker(args)
|
||||||
}
|
}
|
||||||
|
|
||||||
local update_graphic = function(widget, stdout, _, _, _)
|
local update_graphic = function(widget, stdout, _, _, _)
|
||||||
local mute = string.match(stdout, "%[(o%D%D?)%]")
|
local mute = string.match(stdout, "%[(o%D%D?)%]") -- \[(o\D\D?)\] - [on] or [off]
|
||||||
local volume = string.match(stdout, "(%d?%d?%d)%%")
|
local volume = string.match(stdout, "(%d?%d?%d)%%") -- (\d?\d?\d)\%)
|
||||||
volume = tonumber(string.format("% 3d", volume))
|
volume = tonumber(string.format("% 3d", volume))
|
||||||
|
|
||||||
widget.value = volume / 100;
|
widget.value = volume / 100;
|
||||||
|
|
Loading…
Reference in New Issue