diff --git a/examples/hello/app/simulator.nix b/examples/hello/app/simulator.nix index 73d7f64a..feef1978 100644 --- a/examples/hello/app/simulator.nix +++ b/examples/hello/app/simulator.nix @@ -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"; diff --git a/examples/hello/app/windows/inputs.rb b/examples/hello/app/windows/inputs.rb new file mode 100644 index 00000000..15869142 --- /dev/null +++ b/examples/hello/app/windows/inputs.rb @@ -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 diff --git a/examples/hello/app/windows/main.rb b/examples/hello/app/windows/main.rb index 919a9231..fd7baf9e 100644 --- a/examples/hello/app/windows/main.rb +++ b/examples/hello/app/windows/main.rb @@ -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 }],