fusuma 3.8.0 → 3.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fcdbd20f4f5c91e04133f135869a38c5f6c9e4dd3dfb49dd88930baa65a989f0
4
- data.tar.gz: a4885c3d8cb292cad9af3bb28cbb444f460cd5d2a6c3b989951de114587dbe55
3
+ metadata.gz: 25a6fc321e7305354cb3b86d331dd4ec749043eaeef977dc125efbd0a515533f
4
+ data.tar.gz: 5621071b0f8cf1997dbed8a4cd25afbe7cd9721ee6d9ec0178c201d2fcd20f37
5
5
  SHA512:
6
- metadata.gz: d110077da416736b0ead983657d0b1ce900b8ac9a58e9c5f9373f6483bb3c6b97120918610f7d8eb5e9bf73183dc273c29c2c5b92ae0378617962ae101d29489
7
- data.tar.gz: 2bf50d5806c511858484305b930dea41e5adfc8b22acdf9a782c15db7b4aba8c648c98defbcedb670d273bb08c13b5240b3d951882473e65bc584ade638c8dc1
6
+ metadata.gz: adc8d6c912cb7e650ed51e7c28a021e58a3be91a61190458e7e25bc7450051b01cbc10876c882fde11e70c60575c64163f547dbb6932e5c4a6682792fb995375
7
+ data.tar.gz: 2796ede1b96046738a3e1feb93f0137a7f4b48fd599752b9b4d6ab047f9ffdcf082f2aaf94ef4988f3cafde150e89522db057222804acdaf8d2f80593ed0d543
@@ -6,7 +6,6 @@ module Fusuma
6
6
  # index for config.yml
7
7
  class Index
8
8
  def initialize(keys)
9
- @count = 0
10
9
  case keys
11
10
  when Array
12
11
  @keys = []
@@ -24,7 +24,7 @@ module Fusuma
24
24
  def shutdown
25
25
  child_pids.each do |pid|
26
26
  Process.kill("TERM", pid)
27
- rescue Errno::ESRCH
27
+ rescue Errno::ESRCH, IOError
28
28
  # ignore
29
29
  end
30
30
 
data/lib/fusuma/device.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require_relative "multi_logger"
4
- require_relative "libinput_command"
4
+ require "fusuma/plugin/inputs/libinput_command_input"
5
5
 
6
6
  module Fusuma
7
7
  # detect input device
@@ -65,13 +65,16 @@ module Fusuma
65
65
  def fetch_devices
66
66
  line_parser = LineParser.new
67
67
 
68
- libinput_command = Plugin::Inputs::LibinputCommandInput.new.command
69
68
  # note: this libinput command takes a nontrivial amount of time (~200ms)
70
69
  libinput_command.list_devices do |line|
71
70
  line_parser.push(line)
72
71
  end
73
72
  line_parser.generate_devices
74
73
  end
74
+
75
+ def libinput_command
76
+ @libinput_command ||= Plugin::Inputs::LibinputCommandInput.new.command
77
+ end
75
78
  end
76
79
 
77
80
  # parse line and generate devices
@@ -36,11 +36,14 @@ module Fusuma
36
36
  def list_devices(&block)
37
37
  cmd = list_devices_command
38
38
  MultiLogger.debug(list_devices: cmd)
39
- i, o, e, _w = Open3.popen3(cmd)
40
- MultiLogger.error(e.read) if o.eof?
41
- i.close
42
- e.close
43
- o.each(&block)
39
+ o, e, s = Open3.capture3(cmd)
40
+
41
+ unless s.success?
42
+ MultiLogger.error("libinput list-devices failed with output: #{o}")
43
+ return
44
+ end
45
+
46
+ o.each_line(&block)
44
47
  end
45
48
 
46
49
  # @return [Integer] return a latest line libinput debug-events
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Fusuma
4
- VERSION = "3.8.0"
4
+ VERSION = "3.9.0"
5
5
  end
data/lib/fusuma.rb CHANGED
@@ -15,8 +15,8 @@ module Fusuma
15
15
  def run(option = {})
16
16
  read_options(option)
17
17
  instance = new
18
- instance.initialize_plugins
19
18
  instance.set_trap
19
+ instance.initialize_plugins
20
20
  ## NOTE: Uncomment following line to measure performance
21
21
  # instance.run_with_lineprof
22
22
  instance.run
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fusuma
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.8.0
4
+ version: 3.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - iberianpig
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2025-04-02 00:00:00.000000000 Z
11
+ date: 2025-05-26 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Fusuma is multitouch gesture recognizer. This gem makes your touchpad
14
14
  on Linux able to recognize swipes or pinchs and assign command to them. Read installation