Skip to content

Commit 660dc81

Browse files
committed
chore: refactors to volume pr #460 i forgot
whoops
1 parent 3c7e434 commit 660dc81

File tree

7 files changed

+203
-177
lines changed

7 files changed

+203
-177
lines changed

Diff for: docs/modules/Volume.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ the default playback device, and control application volume levels individually.
44

55
This requires PulseAudio to function (`pipewire-pulse` is supported).
66

7-
TODO: Screenshot
7+
[!The volume widget, with its popup open. A single stream is playing audio.](https://f.jstanger.dev/github/ironbar/volume.png)
88

99
## Configuration
1010

Diff for: examples/config.json

+78-67
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,67 @@
11
{
22
"anchor_to_edges": true,
3+
"position": "bottom",
4+
"icon_theme": "Paper",
5+
"start": [
6+
{
7+
"type": "workspaces",
8+
"all_monitors": false,
9+
"name_map": {
10+
"1": "󰙯",
11+
"2": "icon:firefox",
12+
"3": "",
13+
"Games": "icon:steam",
14+
"Code": ""
15+
}
16+
},
17+
{
18+
"type": "launcher",
19+
"favorites": [
20+
"firefox",
21+
"discord",
22+
"steam"
23+
],
24+
"show_names": false,
25+
"show_icons": true
26+
},
27+
{
28+
"type": "label",
29+
"label": "random num: {{500:echo FIXME}}"
30+
}
31+
],
332
"end": [
433
{
5-
"music_dir": "/home/jake/Music",
34+
"type": "music",
635
"player_type": "mpd",
36+
"music_dir": "/home/jake/Music",
737
"truncate": {
8-
"max_length": 100,
9-
"mode": "end"
10-
},
11-
"type": "music"
38+
"mode": "end",
39+
"max_length": 100
40+
}
1241
},
1342
{
14-
"host": "chloe:6600",
43+
"type": "music",
1544
"player_type": "mpd",
16-
"truncate": "end",
17-
"type": "music"
45+
"host": "chloe:6600",
46+
"truncate": "end"
1847
},
1948
{
49+
"type": "script",
2050
"cmd": "/home/jake/bin/phone-battery",
2151
"show_if": {
2252
"cmd": "/home/jake/bin/phone-connected",
2353
"interval": 500
24-
},
25-
"type": "script"
54+
}
2655
},
2756
{
57+
"type": "sys_info",
58+
"interval": {
59+
"memory": 30,
60+
"cpu": 1,
61+
"temps": 5,
62+
"disks": 300,
63+
"networks": 3
64+
},
2865
"format": [
2966
" {cpu_percent}% | {temp_c:k10temp_Tccd1}°C",
3067
" {memory_used} / {memory_total} GB ({memory_percent}%)",
@@ -33,103 +70,77 @@
3370
"󰓢 {net_down:enp39s0} / {net_up:enp39s0} Mbps",
3471
"󰖡 {load_average:1} | {load_average:5} | {load_average:15}",
3572
"󰥔 {uptime}"
36-
],
37-
"interval": {
38-
"cpu": 1,
39-
"disks": 300,
40-
"memory": 30,
41-
"networks": 3,
42-
"temps": 5
43-
},
44-
"type": "sys_info"
73+
]
74+
},
75+
{
76+
"type": "volume",
77+
"format": "{icon} {volume}%",
78+
"max_volume": 100,
79+
"icons": {
80+
"volume_high": "󰕾",
81+
"volume_medium": "󰖀",
82+
"volume_low": "󰕿",
83+
"muted": "󰝟"
84+
}
4585
},
4686
{
87+
"type": "clipboard",
4788
"max_items": 3,
4889
"truncate": {
49-
"length": 50,
50-
"mode": "end"
51-
},
52-
"type": "clipboard"
90+
"mode": "end",
91+
"length": 50
92+
}
5393
},
5494
{
95+
"type": "custom",
96+
"class": "power-menu",
5597
"bar": [
5698
{
57-
"label": "",
99+
"type": "button",
58100
"name": "power-btn",
59-
"on_click": "popup:toggle",
60-
"type": "button"
101+
"label": "",
102+
"on_click": "popup:toggle"
61103
}
62104
],
63-
"class": "power-menu",
64105
"popup": [
65106
{
66-
"orientation": "vertical",
67107
"type": "box",
108+
"orientation": "vertical",
68109
"widgets": [
69110
{
70-
"label": "Power menu",
111+
"type": "label",
71112
"name": "header",
72-
"type": "label"
113+
"label": "Power menu"
73114
},
74115
{
75116
"type": "box",
76117
"widgets": [
77118
{
119+
"type": "button",
78120
"class": "power-btn",
79121
"label": "<span font-size='40pt'></span>",
80-
"on_click": "!shutdown now",
81-
"type": "button"
122+
"on_click": "!shutdown now"
82123
},
83124
{
125+
"type": "button",
84126
"class": "power-btn",
85127
"label": "<span font-size='40pt'></span>",
86-
"on_click": "!reboot",
87-
"type": "button"
128+
"on_click": "!reboot"
88129
}
89130
]
90131
},
91132
{
92-
"label": "Uptime: {{30000:uptime -p | cut -d ' ' -f2-}}",
133+
"type": "label",
93134
"name": "uptime",
94-
"type": "label"
135+
"label": "Uptime: {{30000:uptime -p | cut -d ' ' -f2-}}"
95136
}
96137
]
97138
}
98139
],
99-
"tooltip": "Up: {{30000:uptime -p | cut -d ' ' -f2-}}",
100-
"type": "custom"
140+
"tooltip": "Up: {{30000:uptime -p | cut -d ' ' -f2-}}"
101141
},
102142
{
103143
"type": "clock"
104144
}
105-
],
106-
"icon_theme": "Paper",
107-
"position": "bottom",
108-
"start": [
109-
{
110-
"all_monitors": false,
111-
"name_map": {
112-
"1": "󰙯",
113-
"2": "icon:firefox",
114-
"3": "",
115-
"Code": "",
116-
"Games": "icon:steam"
117-
},
118-
"type": "workspaces"
119-
},
120-
{
121-
"favorites": [
122-
"firefox",
123-
"discord",
124-
"steam"
125-
],
126-
"show_icons": true,
127-
"show_names": false,
128-
"type": "launcher"
129-
},
130-
{
131-
"label": "random num: {{500:echo FIXME}}",
132-
"type": "label"
133-
}
134145
]
135146
}

0 commit comments

Comments
 (0)