1
1
mirror of https://github.com/NixOS/mobile-nixos.git synced 2024-12-14 09:16:39 +03:00

examples/hello: Add inputs listing to app

This commit is contained in:
Samuel Dionne-Riel 2020-05-31 16:00:08 -04:00
parent 882d410154
commit a01f54348b
3 changed files with 18 additions and 0 deletions

View File

@ -4,6 +4,7 @@
, mrbgems
, mruby
, mobile-nixos
, input-utils
}:
let
@ -19,6 +20,9 @@ in
(script-loader.wrap {
name = "simulator";
applet = "${applet}/libexec/app.mrb";
env = {
PATH = "${input-utils}/bin:$PATH";
};
}).overrideAttrs(old: rec {
pname = "hello-gui-simulator";
version = "0.0.1";

View File

@ -0,0 +1,13 @@
module GUI
class InputsWindow < BaseLogWindow
COMMAND = "lsinput"
def initialize()
super(explanation: "Output of #{COMMAND}")
end
def on_present()
set_text(`#{COMMAND} 2>&1`)
end
end
end

View File

@ -13,6 +13,7 @@ module GUI
add_buttons([
["Display validation", ->() { DisplayValidationWindow.instance.present }],
["Input devices information", ->() { InputsWindow.instance.present }],
["Disks information", ->() { DisksWindow.instance.present }],
["Logs", ->() { LogsWindow.instance.present }],
["About", ->() { AboutWindow.instance.present }],