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:
parent
882d410154
commit
a01f54348b
@ -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";
|
||||
|
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([
|
||||
["Display validation", ->() { DisplayValidationWindow.instance.present }],
|
||||
["Input devices information", ->() { InputsWindow.instance.present }],
|
||||
["Disks information", ->() { DisksWindow.instance.present }],
|
||||
["Logs", ->() { LogsWindow.instance.present }],
|
||||
["About", ->() { AboutWindow.instance.present }],
|
||||
|
Loading…
Reference in New Issue
Block a user