1
1
mirror of https://github.com/NixOS/mobile-nixos.git synced 2024-12-15 19:23:01 +03:00

Merge pull request #92 from samueldr-wip/feature/boot-gui/vt-restore

boot/gui: Fix console restoring on exit
This commit is contained in:
Samuel Dionne-Riel 2020-03-08 18:07:13 -04:00 committed by GitHub
commit 49facfc05c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 14 deletions

View File

@ -289,15 +289,18 @@ end
if File.exist?(SELECTIONS)
JSON.parse(File.read(SELECTIONS)).each do |selection|
ui.button(selection["name"], page: :generations).tap do |btn|
btn.event_handler = ->(event) do
case event
when LVGL::EVENT::CLICKED
File.write("/run/boot/choice", selection["id"])
exit 0
end
end
end
ui.button(selection["name"], page: :generations).tap do |btn|
btn.event_handler = ->(event) do
case event
when LVGL::EVENT::CLICKED
File.write("/run/boot/choice", selection["id"])
# Put back the console on the framebuffer
VTConsole.map_console(1)
exit 0
end
end
end
end
end
@ -305,8 +308,4 @@ end
while true
LVGL::Hacks::LVTask.handle_tasks
sleep(1.0/REFRESH_RATE)
# TODO : Allow exiting!
end
# Put back the console on the framebuffer
VTConsole.map_console(1)

View File

@ -2,6 +2,7 @@
, lib
, callPackage
, mrbgems
, mruby
}:
let
@ -20,7 +21,7 @@ stdenv.mkDerivation {
src = lib.cleanSource ./.;
nativeBuildInputs = [
loader.mruby
mruby
];
buildPhase = ''