Class: Fusuma::Environment
- Inherits:
-
Object
- Object
- Fusuma::Environment
- Defined in:
- lib/fusuma/environment.rb
Overview
Output Environment information
Class Method Summary collapse
- .dump_information ⇒ Object
- .print_config ⇒ Object
- .print_device_list ⇒ Object
- .print_enabled_plugins ⇒ Object
- .print_version ⇒ Object
Class Method Details
.dump_information ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/fusuma/environment.rb', line 11 def dump_information MultiLogger.info "---------------------------------------------" print_version MultiLogger.info "---------------------------------------------" print_enabled_plugins MultiLogger.info "---------------------------------------------" end |
.print_config ⇒ Object
43 44 45 46 47 |
# File 'lib/fusuma/environment.rb', line 43 def print_config Config.instance.keymap.each do |conf| puts conf.deep_stringify_keys.to_yaml end end |
.print_device_list ⇒ Object
37 38 39 40 41 |
# File 'lib/fusuma/environment.rb', line 37 def print_device_list Plugin::Filters::LibinputDeviceFilter.new.keep_device.all.map do |device| puts device.name end end |
.print_enabled_plugins ⇒ Object
29 30 31 32 33 34 35 |
# File 'lib/fusuma/environment.rb', line 29 def print_enabled_plugins MultiLogger.info "Enabled Plugins: " Plugin::Manager.plugins .reject { |k, _v| k.to_s =~ /Base/ } .map { |_base, plugins| plugins.map { |plugin| " #{plugin}" } } .flatten.sort.each { |name| MultiLogger.info(name) } end |
.print_version ⇒ Object
19 20 21 22 23 24 25 26 27 |
# File 'lib/fusuma/environment.rb', line 19 def print_version libinput_command = Plugin::Inputs::LibinputCommandInput.new.command MultiLogger.info "Fusuma: #{VERSION}" MultiLogger.info "libinput: #{libinput_command.version}" MultiLogger.info "ruby #{RUBY_VERSION}p#{RUBY_PATCHLEVEL}" MultiLogger.info "OS: #{`uname -rsv`}".strip MultiLogger.info "Distribution: #{`cat /etc/issue`}".strip MultiLogger.info "Desktop session: #{`echo $DESKTOP_SESSION $XDG_SESSION_TYPE`}".strip end |