Skip to content

Commit a4013ba

Browse files
bgm123.sh - simplify _get_vars_bgm123 function and calls
1 parent 238434e commit a4013ba

File tree

1 file changed

+5
-34
lines changed

1 file changed

+5
-34
lines changed

scriptmodules/supplementary/bgm123.sh

Lines changed: 5 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ function _get_vars_bgm123() {
3030
)
3131

3232
local var
33-
for var in "$@"; do
33+
for var in "${!path[@]}"; do
3434
echo "local $var=${path[$var]}"
3535
done
3636
}
@@ -40,11 +40,7 @@ function depends_bgm123() {
4040
}
4141

4242
function install_bin_bgm123() {
43-
local vars=(
44-
'config'
45-
'menudir'
46-
)
47-
$(_get_vars_bgm123 "${vars[@]}")
43+
$(_get_vars_bgm123)
4844

4945
local file
5046
local scripts=(
@@ -66,15 +62,7 @@ function install_bin_bgm123() {
6662
}
6763

6864
function configure_bgm123() {
69-
local vars=(
70-
'autostart'
71-
'bashrc'
72-
'onstart'
73-
'onend'
74-
'config'
75-
'menudir'
76-
)
77-
$(_get_vars_bgm123 "${vars[@]}")
65+
$(_get_vars_bgm123)
7866

7967
local share="$datadir/bgm"
8068
local file
@@ -141,17 +129,7 @@ function configure_bgm123() {
141129

142130
function toggle_bgm123() {
143131
local file
144-
local vars=(
145-
'autostart'
146-
'bashrc'
147-
'onstart'
148-
'onend'
149-
'config'
150-
'init'
151-
'killscript'
152-
'fadescript'
153-
)
154-
$(_get_vars_bgm123 "${vars[@]}")
132+
$(_get_vars_bgm123)
155133

156134
# attempt to remove any existing bgm config
157135
for file in "$autostart" "$bashrc" "$onstart" "$onend"; do
@@ -206,14 +184,7 @@ function enable_bgm123() {
206184
}
207185

208186
function gui_bgm123() {
209-
local vars=(
210-
'autostart'
211-
'config'
212-
'init'
213-
'killscript'
214-
'fadescript'
215-
)
216-
$(_get_vars_bgm123 "${vars[@]}")
187+
$(_get_vars_bgm123)
217188

218189
while true; do
219190
iniConfig "=" '"' "$config"

0 commit comments

Comments
 (0)