summaryrefslogtreecommitdiff
path: root/volumearc-widget
diff options
context:
space:
mode:
authorstreetturtle <streetturtle@gmail.com>2019-04-13 20:51:54 -0400
committerstreetturtle <streetturtle@gmail.com>2019-04-13 20:51:54 -0400
commit93ef029bdbcc1a1f6de927b1351d7169ba9b698e (patch)
tree21e26c9863f02412b8de82195c25ed56b32ab68b /volumearc-widget
parent94f818ac1a2a47f37da8db92cf94aa56b263ecef (diff)
update volumearc readme
Diffstat (limited to 'volumearc-widget')
-rw-r--r--volumearc-widget/README.md24
-rw-r--r--volumearc-widget/custom.pngbin0 -> 9424 bytes
-rw-r--r--volumearc-widget/volumearc.lua4
3 files changed, 23 insertions, 5 deletions
diff --git a/volumearc-widget/README.md b/volumearc-widget/README.md
index 79f519d..5bd8e83 100644
--- a/volumearc-widget/README.md
+++ b/volumearc-widget/README.md
@@ -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}
+## 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
1. Clone this repo under **~/.config/awesome/**
@@ -29,12 +47,12 @@ Almost the same as [volumebar widget](https://github.com/streetturtle/awesome-wm
volumearc_widget(),
--[[or customized]]
volumearc_widget({
- main_color = '#0000ff',
+ main_color = '#af13f7',
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,
height = 25
}),
...
- ``` \ No newline at end of file
+ ```
diff --git a/volumearc-widget/custom.png b/volumearc-widget/custom.png
new file mode 100644
index 0000000..f187345
--- /dev/null
+++ b/volumearc-widget/custom.png
Binary files differ
diff --git a/volumearc-widget/volumearc.lua b/volumearc-widget/volumearc.lua
index 4a91cd3..5fbf3dd 100644
--- a/volumearc-widget/volumearc.lua
+++ b/volumearc-widget/volumearc.lua
@@ -59,8 +59,8 @@ local function worker(args)
}
local update_graphic = function(widget, stdout, _, _, _)
- local mute = string.match(stdout, "%[(o%D%D?)%]")
- local volume = string.match(stdout, "(%d?%d?%d)%%")
+ local mute = string.match(stdout, "%[(o%D%D?)%]") -- \[(o\D\D?)\] - [on] or [off]
+ local volume = string.match(stdout, "(%d?%d?%d)%%") -- (\d?\d?\d)\%)
volume = tonumber(string.format("% 3d", volume))
widget.value = volume / 100;