;show_widget=true

[@Configure]

[Memory Hack]

[*Bootloader INI]
;mode=option
file_source '/bootloader/hekate_ipl.ini'
file_source '/bootloader/ini/*.ini'
filter '/bootloader/ini/hekate_ipl.ini'

set-footer '{file_name}'
set-ini-val './config.ini' '*Bootloader INI' 'ini_path' '{file_source}'


[*mesosphere]
;mode=option
json '{"1.10":"(1.85 MB,stripped)", "1.9":"(1.85 MB,stripped)", "null":"(stripped)"}'
list_source '{json({split({ams_version},".",0)}.{split({ams_version},".",1)})}'
set-footer '{list_source(*)}'
json '{"stripped":"notify"}'
{json({list_source(*)})} "  Web-browser will be broken." 24

[gap]
;mode=table
;background=false
;gap=12


[Patch INI]
ini_file './config.ini'
json '{"1.85 MB":"","stripped":""}'
try:
path_exists '{ini_file("*Bootloader INI",ini_path)}{json({ini_file("*mesosphere",footer)})}'

json '{"1.85 MB":"1.85MB_{split({ams_version},".",0)}.{split({ams_version},".",1)}","stripped":"stripped"}'
path_exists './data/mesosphere_{json({ini_file("*mesosphere",footer)})}.bin'
cp './data/mesosphere_{json({ini_file("*mesosphere",footer)})}.bin' '/atmosphere/'
set-ini-val-matching-key '{ini_file("*Bootloader INI",ini_path)}' 'cal0blank' kernel 'atmosphere/mesosphere_{json({ini_file("*mesosphere",footer)})}.bin'
notify '  Reboot is required.'

[Unpatch INI]
ini_file './config.ini'
json '{"1.85 MB":"","stripped":""}'
try:
path_exists '{ini_file("*Bootloader INI",ini_path)}{json({ini_file("*mesosphere",footer)})}'
remove-ini-key-matching-key '{ini_file("*Bootloader INI",ini_path)}' 'cal0blank' kernel
notify '  Reboot is required.'


[*Selectively Apply]
[*Apply Patch]
ini_file './config.ini'
json '{"1.85 MB":"","stripped":""}'
ini_file_source '{ini_file("*Bootloader INI",ini_path)}{json({ini_file("*mesosphere",footer)})}'
filter config

json '{"1.85 MB":"1.85MB_{split({ams_version},".",0)}.{split({ams_version},".",1)}","stripped":"stripped"}'

try:
path_exists './data/mesosphere_{json({ini_file("*mesosphere",footer)})}.bin'
set-ini-val '{ini_file("*Bootloader INI",ini_path)}' '{ini_file_source(*)}' kernel 'atmosphere/mesosphere_{json({ini_file("*mesosphere",footer)})}.bin'
cp './data/mesosphere_{json({ini_file("*mesosphere",footer)})}.bin' '/atmosphere/'
notify '  Reboot is required.'


[*Remove Patch]
ini_file './config.ini'
json '{"1.85 MB":"","stripped":""}'
ini_file_source '{ini_file("*Bootloader INI",ini_path)}{json({ini_file("*mesosphere",footer)})}'
filter config
remove-ini-key '{ini_file("*Bootloader INI",ini_path)}' '{ini_file_source(*)}' kernel
notify '  Reboot is required.'



[Commands]

[Reboot - ]
;hold=true
reboot

[@View INI]

[Bootloader INI Header]
;mode=table
;background=false
;spacing=4
;gap=20
;header_indent=true
;section_text_color=header
ini_file './config.ini'
json '{"null.ini":"Not available", "{ini_file(*Bootloader INI,footer)}.ini":"{ini_file(*Bootloader INI,footer)}.ini"}'
'{json({ini_file(*Bootloader INI,footer)}.ini)}'=''

[Bootloader INI Table]
;mode=table
;wrapping_mode=char
;wrapping_indent=true
;spacing=4
ini_file './config.ini'
list_file_source '{ini_file("*Bootloader INI",ini_path)}'
