lib/fusuma/event_trigger.rb in fusuma-0.9.1 vs lib/fusuma/event_trigger.rb in fusuma-0.9.2

- old
+ new

@@ -6,21 +6,19 @@ @direction = direction @action_type = action_type end attr_reader :finger, :direction, :action_type - def send_command + def exec_command + return if command.nil? + `#{command}` MultiLogger.info("trigger event: #{command}") - exec_command(command) end private - def exec_command(command) - `#{command}` unless command.nil? - end - def command - Config.command(self) || "xdotool key #{Config.shortcut(self)}" + Config.command(self).tap { |c| return c if c } + Config.shortcut(self).tap { |s| return "xdotool key #{s}" if s } end end end