A modern Music Player Daemon based on Rockbox open source high quality audio player
libadwaita audio rust zig deno mpris rockbox mpd
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

lua add a way to filter settings on read rather than dumping all the settings allow a filter function to choose desired settings

in menucoresettings you can see an how to do exact text matches
or wilcard matches you can even use luas version of regex

Change-Id: I4c7f7592498ea194e06e9a556b77ffd57f5d4223

+17 -8
+12 -6
apps/plugins/lua/include_lua/menucoresettings.lua
··· 39 39 40 40 tmploader("rbsettings") 41 41 tmploader("settings") 42 + -- these are exact matches color and talk are wildcard matches 43 + local list_settings = "cursor_style|show_icons|statusbar|scrollbar|scrollbar_width|list_separator_height|backdrop_file|" 44 + local function filterfn(struct, k) 45 + k = k or "" 46 + --rbold.splash(100, struct .. " " .. k) 47 + return (k:find("color") or k:find("talk") or list_settings:find(k)) 48 + end 49 + local rb_settings = rb.settings.dump('global_settings', "system", nil, nil, filterfn) 42 50 43 - local rb_settings = rb.settings.dump('global_settings', "system") 44 51 local color_table = {} 45 52 local talk_table = {} 46 53 local list_settings_table = {} 47 - local list_settings = "cursor_style|show_icons|statusbar|scrollbar|scrollbar_width|list_separator_height|backdrop_file|" 48 54 49 55 for key, value in pairs(rb_settings) do 50 56 key = key or "" 51 57 if (key:find("color")) then 52 - color_table[key]=value 58 + color_table[key]=value 53 59 elseif (key:find("talk")) then 54 - talk_table[key]=value 55 - elseif (list_settings:find(key)) then 56 - list_settings_table[key]=value 60 + talk_table[key]=value 61 + else --if (list_settings:find(key)) then 62 + list_settings_table[key]=value 57 63 end 58 64 end 59 65
+5 -2
apps/plugins/lua/include_lua/rbsettings.lua
··· 151 151 return data 152 152 end 153 153 154 - function rb.settings.dump(s_settings, s_groupname, s_structname, t_output) 154 + function rb.settings.dump(s_settings, s_groupname, s_structname, t_output, fn_filter) 155 155 t_output = t_output or {} 156 + fn_filter = fn_filter or function(s,k) return true end 156 157 local tgroup = rb[s_groupname] 157 158 s_structname = s_structname or s_settings 158 159 for k, v in pairs(tgroup[s_structname]) do 159 - t_output[k] = rb.settings.read(s_settings, v, s_groupname) 160 + if fn_filter(s_structname, k) then 161 + t_output[k] = rb.settings.read(s_settings, v, s_groupname) 162 + end 160 163 end 161 164 return t_output 162 165 end