Add profiles module docs and samples

This commit is contained in:
Evgeny
2024-08-07 20:44:11 +04:00
parent b5840ee5bb
commit d063132df2
3 changed files with 43 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
-- This script shows how to dump/restore profile without saving it to the system
curr_profile = ""
function on_resume()
ui:show_lines{
"Dump profile",
"Restore profile"
}
end
function on_click(idx)
if idx == 1 then
curr_profile = profiles:dump_json()
ui:show_toast("Saved")
else
ui:show_toast("Restoring...")
profiles:restore_json(curr_profile)
end
end