lib/fusuma/libinput_commands.rb in fusuma-0.8.0 vs lib/fusuma/libinput_commands.rb in fusuma-0.9.0

- old
+ new

@@ -68,12 +68,14 @@ 'libinput-debug-events' end end private - + # use device option only if libinput detect only 1 device + # @return [String] def device_option - "--device /dev/input/#{Device.names.first}" if Device.names.size == 1 + return unless Device.available.size == 1 + "--device /dev/input/#{Device.available.first.id}" end # which in ruby: Checking if program exists in $PATH from ruby # (https://stackoverflow.com/questions/2108727/which-in-ruby-checking-if-program-exists-in-path-from-ruby) # Cross-platform way of finding an executable in the $PATH.