2017-10-05 02:46:09 +02:00
# Volumearc widget
2017-10-09 22:20:20 +02:00
2019-09-04 03:57:24 +02:00
Almost the same as [volumebar widget ](https://github.com/streetturtle/awesome-wm-widgets/tree/master/volumebar-widget ), but using [arcchart ](https://awesomewm.org/doc/api/classes/wibox.container.arcchart.html ):
2017-10-09 22:20:20 +02:00
2019-12-15 21:55:38 +01:00
![screenshot ](./out.gif )
2017-10-09 22:20:20 +02:00
2019-04-14 04:46:16 +02:00
Supports
- scroll up - increase volume,
- scroll down - decrease volume,
- left click - mute/unmute.
2019-04-14 02:51:54 +02:00
## Customization
It is possible to customize widget by providing a table with all or some of the following config parameters:
2019-04-15 02:07:15 +02:00
| Name | Default | Description |
|---|---|---|
| `main_color` | `beautiful.fg_normal` | Color of the arc |
2020-02-07 10:27:02 +01:00
| `bg_color` | `#ffffff11` | Color of the arc's background |
2019-04-15 02:07:15 +02:00
| `mute_color` | `beautiful.fg_urgent` | Color of the arc when mute |
| `path_to_icon` | /usr/share/icons/Arc/status/symbolic/audio-volume-muted-symbolic.svg | Path to the icon |
| `thickness` | 2 | The arc thickness |
| `height` | `beautiful.fg_normal` | Widget height |
| `get_volume_cmd` | `amixer -D pulse sget Master` | Get current volume level |
| `inc_volume_cmd` | `amixer -D pulse sset Master 5%+` | Increase volume level |
2019-10-07 03:37:35 +02:00
| `dec_volume_cmd` | `amixer -D pulse sset Master 5%-` | Decrease volume level |
2019-04-15 02:07:15 +02:00
| `tog_volume_cmd` | `amixer -D pulse sset Master toggle` | Mute / unmute |
2020-05-29 17:53:10 +02:00
| `button_press` | `function(_, _, _, button) <sane default logic> end` | Overwrite the 'button\_press' signal for this widget |
2019-04-15 02:07:15 +02:00
### Example:
2019-04-14 02:51:54 +02:00
```lua
volumearc_widget({
main_color = '#af13f7',
mute_color = '#ff0000',
thickness = 5,
2020-05-29 17:53:10 +02:00
height = 25,
button_press = function(_, _, _ , button) -- Overwrites the button press behaviour to open pavucontrol when clicked
if (button == 1) then awful.spawn('pavucontrol --tab=3', false)
end
end
2019-04-14 02:51:54 +02:00
})
```
2019-06-03 04:06:02 +02:00
The config above results in the following widget:
2019-04-14 02:51:54 +02:00
![custom ](./custom.png )
2017-10-09 22:20:20 +02:00
## Installation
2019-03-30 22:42:59 +01:00
1. Clone this repo under ** ~/.config/awesome/**
```bash
2020-04-25 16:58:59 +02:00
git clone https://github.com/streetturtle/awesome-wm-widgets.git ~/.config/awesome/awesome-wm-widgets
2019-03-30 22:42:59 +01:00
```
1. Require volumearc widget at the beginning of **rc.lua** :
2019-05-03 21:23:12 +02:00
```lua
2020-04-25 16:58:59 +02:00
local volumearc_widget = require("awesome-wm-widgets.volumearc-widget.volumearc")
2019-05-03 21:23:12 +02:00
...
s.mytasklist, -- Middle widget
{ -- Right widgets
layout = wibox.layout.fixed.horizontal,
...
2020-07-17 06:57:00 +02:00
volumearc_widget(),
2019-05-03 21:23:12 +02:00
...
```