Class: Omnibar::System

Inherits:
Query
  • Object
show all
Defined in:
lib/omnibar/system.rb

Overview

System Commands

Interact with your system

Constant Summary collapse

COMMANDS =
{
  'sleep' => 'xset -display :0.0 dpms force off',
  'reboot' => 'reboot',
  'shutdown' => 'shutdown now',
  'power off' => 'shutdown now'
}.freeze

Instance Attribute Summary

Attributes inherited from Query

#input

Instance Method Summary collapse

Methods inherited from Query

#copy_to_clipboard, inherited, #initialize, #open_in_browser, #preview_text

Constructor Details

This class inherits a constructor from Omnibar::Query

Instance Method Details

#perform!Object



23
24
25
# File 'lib/omnibar/system.rb', line 23

def perform!
  puts COMMANDS[result]
end

#resultObject



15
16
17
# File 'lib/omnibar/system.rb', line 15

def result
  search.find(input)
end

#searchObject



19
20
21
# File 'lib/omnibar/system.rb', line 19

def search
  @fz ||= FuzzyMatch.new(COMMANDS.keys)
end