mirror of
https://github.com/NixOS/mobile-nixos.git
synced 2025-01-06 03:27:17 +03:00
examples/hello: Add inputs listing to app
This commit is contained in:
parent
882d410154
commit
a01f54348b
@ -4,6 +4,7 @@
|
|||||||
, mrbgems
|
, mrbgems
|
||||||
, mruby
|
, mruby
|
||||||
, mobile-nixos
|
, mobile-nixos
|
||||||
|
, input-utils
|
||||||
}:
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
@ -19,6 +20,9 @@ in
|
|||||||
(script-loader.wrap {
|
(script-loader.wrap {
|
||||||
name = "simulator";
|
name = "simulator";
|
||||||
applet = "${applet}/libexec/app.mrb";
|
applet = "${applet}/libexec/app.mrb";
|
||||||
|
env = {
|
||||||
|
PATH = "${input-utils}/bin:$PATH";
|
||||||
|
};
|
||||||
}).overrideAttrs(old: rec {
|
}).overrideAttrs(old: rec {
|
||||||
pname = "hello-gui-simulator";
|
pname = "hello-gui-simulator";
|
||||||
version = "0.0.1";
|
version = "0.0.1";
|
||||||
|
13
examples/hello/app/windows/inputs.rb
Normal file
13
examples/hello/app/windows/inputs.rb
Normal 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
|
@ -13,6 +13,7 @@ module GUI
|
|||||||
|
|
||||||
add_buttons([
|
add_buttons([
|
||||||
["Display validation", ->() { DisplayValidationWindow.instance.present }],
|
["Display validation", ->() { DisplayValidationWindow.instance.present }],
|
||||||
|
["Input devices information", ->() { InputsWindow.instance.present }],
|
||||||
["Disks information", ->() { DisksWindow.instance.present }],
|
["Disks information", ->() { DisksWindow.instance.present }],
|
||||||
["Logs", ->() { LogsWindow.instance.present }],
|
["Logs", ->() { LogsWindow.instance.present }],
|
||||||
["About", ->() { AboutWindow.instance.present }],
|
["About", ->() { AboutWindow.instance.present }],
|
||||||
|
Loading…
Reference in New Issue
Block a user