fusuma 3.3.0 → 3.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/fusuma/config/index.rb +9 -3
- data/lib/fusuma/config/searcher.rb +1 -1
- data/lib/fusuma/config.rb +17 -9
- data/lib/fusuma/custom_process.rb +1 -1
- data/lib/fusuma/device.rb +2 -2
- data/lib/fusuma/environment.rb +3 -3
- data/lib/fusuma/plugin/base.rb +1 -1
- data/lib/fusuma/plugin/buffers/gesture_buffer.rb +1 -1
- data/lib/fusuma/plugin/buffers/timer_buffer.rb +1 -1
- data/lib/fusuma/plugin/detectors/hold_detector.rb +1 -1
- data/lib/fusuma/plugin/detectors/pinch_detector.rb +1 -1
- data/lib/fusuma/plugin/detectors/rotate_detector.rb +1 -1
- data/lib/fusuma/plugin/detectors/swipe_detector.rb +1 -1
- data/lib/fusuma/plugin/events/event.rb +2 -2
- data/lib/fusuma/plugin/events/records/gesture_record.rb +5 -1
- data/lib/fusuma/plugin/events/records/index_record.rb +4 -0
- data/lib/fusuma/plugin/events/records/text_record.rb +1 -1
- data/lib/fusuma/plugin/executors/command_executor.rb +1 -1
- data/lib/fusuma/plugin/filters/libinput_device_filter.rb +1 -1
- data/lib/fusuma/plugin/inputs/input.rb +16 -13
- data/lib/fusuma/plugin/inputs/libinput_command_input.rb +2 -2
- data/lib/fusuma/plugin/inputs/timer_input.rb +1 -1
- data/lib/fusuma/plugin/manager.rb +8 -8
- data/lib/fusuma/version.rb +1 -1
- data/lib/fusuma.rb +12 -8
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2069b9d7aebc84b8476061feceda9dbccdc1496d631bc321918c64df252fef40
|
4
|
+
data.tar.gz: 2efa46442f89aa15aa53f4e4b743f6cb4ef2449ca3f487a1a35940ad9ae38b9f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6b13060987b8cceadf030c6601a4f05886b2d0db6c44f900e33f0c5f689afcf48ab98809d12014394da24e9be5bde3b303f15527c792b540e6f352d1b39f4225
|
7
|
+
data.tar.gz: b3620182b6cc50c22582e36927b478c6a68b1e86b3cfe7eee7fc29060e87d2ce1f3e36579e112cbfb62b488927aae427ad75630210c4db53e3127619a487253b
|
data/lib/fusuma/config/index.rb
CHANGED
@@ -14,7 +14,7 @@ module Fusuma
|
|
14
14
|
key = Key.new(key) if !key.is_a? Key
|
15
15
|
@keys << key
|
16
16
|
key.symbol
|
17
|
-
end.join(",")
|
17
|
+
end.join(",").to_sym
|
18
18
|
else
|
19
19
|
key = Key.new(keys)
|
20
20
|
@cache_key = key.symbol
|
@@ -22,10 +22,16 @@ module Fusuma
|
|
22
22
|
end
|
23
23
|
end
|
24
24
|
|
25
|
-
def
|
25
|
+
def to_s
|
26
26
|
@keys.map(&:inspect)
|
27
27
|
end
|
28
28
|
|
29
|
+
def ==(other)
|
30
|
+
return false unless other.is_a? Index
|
31
|
+
|
32
|
+
cache_key == other.cache_key
|
33
|
+
end
|
34
|
+
|
29
35
|
attr_reader :keys, :cache_key
|
30
36
|
|
31
37
|
# Keys in Index
|
@@ -40,7 +46,7 @@ module Fusuma
|
|
40
46
|
@skippable = skippable
|
41
47
|
end
|
42
48
|
|
43
|
-
def
|
49
|
+
def to_s
|
44
50
|
if @skippable
|
45
51
|
"#{@symbol}(skippable)"
|
46
52
|
else
|
@@ -100,7 +100,7 @@ module Fusuma
|
|
100
100
|
# no_context?(&block) ||
|
101
101
|
# complete_match_context(request_context, &block) ||
|
102
102
|
# partial_match_context(request_context, &block)
|
103
|
-
fallbacks.
|
103
|
+
fallbacks.find do |method|
|
104
104
|
result = send(method, request_context, &block)
|
105
105
|
return result if result
|
106
106
|
end
|
data/lib/fusuma/config.rb
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require_relative "
|
4
|
-
require_relative "
|
5
|
-
require_relative "
|
6
|
-
require_relative "
|
7
|
-
require_relative "
|
8
|
-
require_relative "
|
3
|
+
require_relative "multi_logger"
|
4
|
+
require_relative "config/index"
|
5
|
+
require_relative "config/searcher"
|
6
|
+
require_relative "config/yaml_duplication_checker"
|
7
|
+
require_relative "plugin/manager"
|
8
|
+
require_relative "hash_support"
|
9
9
|
require "singleton"
|
10
10
|
require "yaml"
|
11
11
|
|
@@ -65,6 +65,7 @@ module Fusuma
|
|
65
65
|
|
66
66
|
# reset searcher cache
|
67
67
|
@searcher = Searcher.new
|
68
|
+
@cache_execute_keys = nil
|
68
69
|
|
69
70
|
self
|
70
71
|
rescue InvalidFileError => e
|
@@ -117,10 +118,17 @@ module Fusuma
|
|
117
118
|
executor.new.execute_keys
|
118
119
|
end.flatten
|
119
120
|
|
120
|
-
|
121
|
-
return if execute_params.nil? || !execute_params.is_a?(Hash)
|
121
|
+
@cache_execute_keys ||= {}
|
122
122
|
|
123
|
-
|
123
|
+
cache_key = [index.cache_key, Searcher.context].join
|
124
|
+
|
125
|
+
return @cache_execute_keys[cache_key] if @cache_execute_keys.has_key?(cache_key)
|
126
|
+
|
127
|
+
@cache_execute_keys[cache_key] =
|
128
|
+
@execute_keys.find do |execute_key|
|
129
|
+
new_index = Config::Index.new(index.keys | [execute_key])
|
130
|
+
search(new_index)
|
131
|
+
end
|
124
132
|
end
|
125
133
|
|
126
134
|
private
|
data/lib/fusuma/device.rb
CHANGED
data/lib/fusuma/environment.rb
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require_relative "
|
4
|
-
require_relative "
|
5
|
-
require_relative "
|
3
|
+
require_relative "version"
|
4
|
+
require_relative "libinput_command"
|
5
|
+
require_relative "multi_logger"
|
6
6
|
|
7
7
|
module Fusuma
|
8
8
|
# Output Environment information
|
data/lib/fusuma/plugin/base.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require_relative "
|
3
|
+
require_relative "text_record"
|
4
4
|
|
5
5
|
module Fusuma
|
6
6
|
module Plugin
|
@@ -29,6 +29,10 @@ module Fusuma
|
|
29
29
|
@finger = finger.to_i
|
30
30
|
@delta = delta
|
31
31
|
end
|
32
|
+
|
33
|
+
def to_s
|
34
|
+
"#{@gesture}, #{@finger}, #{@status}, #{@delta}"
|
35
|
+
end
|
32
36
|
end
|
33
37
|
end
|
34
38
|
end
|
@@ -25,19 +25,22 @@ module Fusuma
|
|
25
25
|
|
26
26
|
input = inputs.find { |i| i.io == io }
|
27
27
|
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
28
|
+
input.create_event(record: input.read_from_io)
|
29
|
+
end
|
30
|
+
|
31
|
+
# @return [String, Record]
|
32
|
+
# IO#readline is blocking method
|
33
|
+
# so input plugin must write line to pipe (include `\n`)
|
34
|
+
# or, override read_from_io and implement your own read method
|
35
|
+
def read_from_io
|
36
|
+
io.readline(chomp: true)
|
37
|
+
rescue EOFError => e
|
38
|
+
MultiLogger.error "#{self.class.name}: #{e}"
|
39
|
+
MultiLogger.error "Shutdown fusuma process..."
|
40
|
+
Process.kill("TERM", Process.pid)
|
41
|
+
rescue => e
|
42
|
+
MultiLogger.error "#{self.class.name}: #{e}"
|
43
|
+
exit 1
|
41
44
|
end
|
42
45
|
|
43
46
|
# @return [Integer]
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require_relative "../../libinput_command"
|
4
|
-
require_relative "
|
4
|
+
require_relative "input"
|
5
5
|
|
6
6
|
module Fusuma
|
7
7
|
module Plugin
|
@@ -57,7 +57,7 @@ module Fusuma
|
|
57
57
|
enable_dwt,
|
58
58
|
disable_dwt,
|
59
59
|
show_keycodes,
|
60
|
-
verbose
|
60
|
+
verbose
|
61
61
|
].compact
|
62
62
|
end
|
63
63
|
|
@@ -101,14 +101,14 @@ module Fusuma
|
|
101
101
|
end
|
102
102
|
|
103
103
|
def require_base_plugins
|
104
|
-
require_relative "
|
105
|
-
require_relative "
|
106
|
-
require_relative "
|
107
|
-
require_relative "
|
108
|
-
require_relative "
|
109
|
-
require_relative "
|
110
|
-
require_relative "
|
111
|
-
require_relative "
|
104
|
+
require_relative "base"
|
105
|
+
require_relative "events/event"
|
106
|
+
require_relative "inputs/input"
|
107
|
+
require_relative "filters/filter"
|
108
|
+
require_relative "parsers/parser"
|
109
|
+
require_relative "buffers/buffer"
|
110
|
+
require_relative "detectors/detector"
|
111
|
+
require_relative "executors/executor"
|
112
112
|
end
|
113
113
|
|
114
114
|
def plugins
|
data/lib/fusuma/version.rb
CHANGED
data/lib/fusuma.rb
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require_relative "
|
4
|
-
require_relative "
|
5
|
-
require_relative "
|
6
|
-
require_relative "
|
7
|
-
require_relative "
|
8
|
-
require_relative "
|
3
|
+
require_relative "fusuma/version"
|
4
|
+
require_relative "fusuma/multi_logger"
|
5
|
+
require_relative "fusuma/config"
|
6
|
+
require_relative "fusuma/environment"
|
7
|
+
require_relative "fusuma/device"
|
8
|
+
require_relative "fusuma/plugin/manager"
|
9
9
|
|
10
10
|
# this is top level module
|
11
11
|
module Fusuma
|
@@ -19,6 +19,10 @@ module Fusuma
|
|
19
19
|
## NOTE: Uncomment following line to measure performance
|
20
20
|
# instance.run_with_lineprof
|
21
21
|
instance.run
|
22
|
+
rescue => e
|
23
|
+
MultiLogger.error("Shutdown by error")
|
24
|
+
MultiLogger.error(e)
|
25
|
+
instance.send(:shutdown)
|
22
26
|
end
|
23
27
|
|
24
28
|
private
|
@@ -191,11 +195,11 @@ module Fusuma
|
|
191
195
|
def set_trap
|
192
196
|
Signal.trap("INT") {
|
193
197
|
shutdown
|
194
|
-
|
198
|
+
exit
|
195
199
|
} # Trap ^C
|
196
200
|
Signal.trap("TERM") {
|
197
201
|
shutdown
|
198
|
-
|
202
|
+
exit
|
199
203
|
} # Trap `Kill `
|
200
204
|
end
|
201
205
|
|
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.
|
4
|
+
version: 3.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- iberianpig
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-01-19 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
|
@@ -87,7 +87,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
87
87
|
- !ruby/object:Gem::Version
|
88
88
|
version: '0'
|
89
89
|
requirements: []
|
90
|
-
rubygems_version: 3.4.
|
90
|
+
rubygems_version: 3.4.19
|
91
91
|
signing_key:
|
92
92
|
specification_version: 4
|
93
93
|
summary: Multitouch gestures with libinput driver, Linux
|