fusuma 3.10.0 → 3.11.1
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 +4 -4
- data/README.md +1 -1
- data/lib/fusuma/device.rb +1 -6
- data/lib/fusuma/libinput_command.rb +4 -1
- data/lib/fusuma/plugin/base.rb +10 -5
- data/lib/fusuma/plugin/filters/libinput_device_filter.rb +3 -1
- data/lib/fusuma/plugin/manager.rb +19 -6
- data/lib/fusuma/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: '064986ef807ceb1aa5ce1d021cdaf8931e44a1099fe8b72cd6aee283bc7ccf3a'
|
|
4
|
+
data.tar.gz: 31d80cdd2c54c1f12a4e55005c4393ae4c3683ed0a0c3a4e506090cc2c0f4f73
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f27789347f194611db15b63f8cd8f04c47e3737ad2349950ab2a9210612f76a96f166c50a136bd2e4e22cce8dd9e640f89a7f8be19f2c282b4a071650cc26af1
|
|
7
|
+
data.tar.gz: 86d0e0bac6c527e7453f4495bde1e58b4b74942b3670ee313d1a7f0323c7a4f9e5ed44c33f64614357ff8b38bbf9e265e074abbd6ce5915925233e3c7f3adc01
|
data/README.md
CHANGED
data/lib/fusuma/device.rb
CHANGED
|
@@ -44,18 +44,13 @@ module Fusuma
|
|
|
44
44
|
end.flatten
|
|
45
45
|
end
|
|
46
46
|
|
|
47
|
-
# @raise [SystemExit]
|
|
48
47
|
# @return [Array]
|
|
49
48
|
#: () -> Array[Device]
|
|
50
49
|
def available
|
|
51
50
|
@available ||= all.select(&:available).tap do |d|
|
|
52
51
|
MultiLogger.debug(available_devices: d)
|
|
53
|
-
|
|
52
|
+
MultiLogger.warn("Touchpad is not found") if d.empty?
|
|
54
53
|
end
|
|
55
|
-
rescue RuntimeError => e
|
|
56
|
-
# FIXME: should not exit without Runner class
|
|
57
|
-
MultiLogger.error(e.message)
|
|
58
|
-
exit 1
|
|
59
54
|
end
|
|
60
55
|
|
|
61
56
|
#: () -> nil
|
|
@@ -39,7 +39,10 @@ module Fusuma
|
|
|
39
39
|
#: () { (String) -> void } -> void
|
|
40
40
|
def list_devices(&block)
|
|
41
41
|
cmd = list_devices_command
|
|
42
|
-
|
|
42
|
+
unless @logged_list_devices
|
|
43
|
+
MultiLogger.debug(list_devices: cmd)
|
|
44
|
+
@logged_list_devices = true
|
|
45
|
+
end
|
|
43
46
|
o, _, s = Open3.capture3(cmd)
|
|
44
47
|
|
|
45
48
|
unless s.success?
|
data/lib/fusuma/plugin/base.rb
CHANGED
|
@@ -8,7 +8,8 @@ module Fusuma
|
|
|
8
8
|
module Plugin
|
|
9
9
|
# Create a Plugin Class with extending this class
|
|
10
10
|
class Base
|
|
11
|
-
# when
|
|
11
|
+
# Callback when a subclass inherits from this class.
|
|
12
|
+
# Registers the subclass with the plugin manager.
|
|
12
13
|
def self.inherited(subclass)
|
|
13
14
|
super
|
|
14
15
|
|
|
@@ -17,7 +18,11 @@ module Fusuma
|
|
|
17
18
|
raise "Plugin class #{subclass.name} must be defined in a file."
|
|
18
19
|
end
|
|
19
20
|
|
|
20
|
-
subclass_path = locations.first
|
|
21
|
+
subclass_path = locations.first&.path
|
|
22
|
+
if subclass_path.nil?
|
|
23
|
+
raise "Plugin class #{subclass.name} must have a valid file path."
|
|
24
|
+
end
|
|
25
|
+
|
|
21
26
|
Manager.add(plugin_class: subclass, plugin_path: subclass_path)
|
|
22
27
|
end
|
|
23
28
|
|
|
@@ -28,13 +33,12 @@ module Fusuma
|
|
|
28
33
|
end
|
|
29
34
|
|
|
30
35
|
# @abstract override `#shutdown` to implement
|
|
31
|
-
#: () ->
|
|
36
|
+
#: () -> void
|
|
32
37
|
def shutdown
|
|
33
38
|
end
|
|
34
39
|
|
|
35
40
|
# config parameter name and Type of the value of parameter
|
|
36
41
|
# @return [Hash]
|
|
37
|
-
#: () -> Hash[Symbol, Array[Class] | Class]
|
|
38
42
|
def config_param_types
|
|
39
43
|
raise NotImplementedError, "override #{self.class.name}##{__method__}"
|
|
40
44
|
end
|
|
@@ -42,7 +46,8 @@ module Fusuma
|
|
|
42
46
|
# @param key [Symbol]
|
|
43
47
|
# @param base [Config::Index]
|
|
44
48
|
# @return [Object]
|
|
45
|
-
#: (
|
|
49
|
+
#: () -> Hash[untyped, untyped]
|
|
50
|
+
#: (Symbol) -> untyped
|
|
46
51
|
def config_params(key = nil)
|
|
47
52
|
@config_params ||= {}
|
|
48
53
|
if @config_params["#{config_index.cache_key},#{key}"]
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
require_relative "filter"
|
|
4
4
|
require_relative "../../device"
|
|
5
|
+
require_relative "../../multi_logger"
|
|
5
6
|
|
|
6
7
|
module Fusuma
|
|
7
8
|
module Plugin
|
|
@@ -72,12 +73,13 @@ module Fusuma
|
|
|
72
73
|
#: () -> Array[Device]
|
|
73
74
|
def all
|
|
74
75
|
@all ||= if @name_patterns.empty?
|
|
75
|
-
Device.available
|
|
76
|
+
Device.all.select(&:available)
|
|
76
77
|
else
|
|
77
78
|
Device.all.select do |device|
|
|
78
79
|
match_pattern?(device.name)
|
|
79
80
|
end
|
|
80
81
|
end.tap do |devices|
|
|
82
|
+
MultiLogger.debug(available_devices: devices)
|
|
81
83
|
print_not_found_messages if devices.empty?
|
|
82
84
|
end
|
|
83
85
|
end
|
|
@@ -33,6 +33,7 @@ module Fusuma
|
|
|
33
33
|
end
|
|
34
34
|
|
|
35
35
|
# @return [Array<String>] paths of external plugins (installed by gem)
|
|
36
|
+
#: () -> Array[untyped]
|
|
36
37
|
def fusuma_external_plugin_paths
|
|
37
38
|
@_fusuma_external_plugin_paths ||=
|
|
38
39
|
Gem.find_latest_files(search_key).map do |siblings_plugin|
|
|
@@ -85,8 +86,13 @@ module Fusuma
|
|
|
85
86
|
# Detectors::PinchDetector,
|
|
86
87
|
# Detectors::SwipeDetector]}
|
|
87
88
|
|
|
88
|
-
#
|
|
89
|
-
#
|
|
89
|
+
# Register a plugin class with the manager.
|
|
90
|
+
# @param plugin_class [Class] the plugin class to register
|
|
91
|
+
# @param plugin_path [String] the file path of the plugin
|
|
92
|
+
# @return [false] if plugin already exists
|
|
93
|
+
# @return [nil] if search_key was already required
|
|
94
|
+
# @return [Array<String>] loaded plugin paths from gems
|
|
95
|
+
#: (plugin_class: Class, plugin_path: String) -> (Array[String] | false | nil)
|
|
90
96
|
def add(plugin_class:, plugin_path:)
|
|
91
97
|
return false if exist?(plugin_class: plugin_class, plugin_path: plugin_path)
|
|
92
98
|
|
|
@@ -108,7 +114,7 @@ module Fusuma
|
|
|
108
114
|
manager.require_siblings_from_gems
|
|
109
115
|
end
|
|
110
116
|
|
|
111
|
-
#: () ->
|
|
117
|
+
#: () -> bool
|
|
112
118
|
def require_base_plugins
|
|
113
119
|
require_relative "base"
|
|
114
120
|
require_relative "events/event"
|
|
@@ -120,7 +126,7 @@ module Fusuma
|
|
|
120
126
|
require_relative "executors/executor"
|
|
121
127
|
end
|
|
122
128
|
|
|
123
|
-
#: () -> Hash[
|
|
129
|
+
#: () -> Hash[String, Array[Class]]
|
|
124
130
|
def plugins
|
|
125
131
|
@plugins ||= {}
|
|
126
132
|
end
|
|
@@ -136,9 +142,16 @@ module Fusuma
|
|
|
136
142
|
@load_paths ||= []
|
|
137
143
|
end
|
|
138
144
|
|
|
139
|
-
#
|
|
140
|
-
#
|
|
145
|
+
# Check if a plugin class is already registered.
|
|
146
|
+
# Note: This intentionally returns false if only the path is registered,
|
|
147
|
+
# allowing multiple plugin classes from the same file (e.g., subclasses).
|
|
148
|
+
# @param plugin_class [Class] the plugin class to check
|
|
149
|
+
# @param plugin_path [String] the file path of the plugin (not used for existence check)
|
|
150
|
+
# @return [Boolean] true if plugin class is already registered
|
|
151
|
+
#: (plugin_class: Class, plugin_path: String) -> bool
|
|
141
152
|
def exist?(plugin_class:, plugin_path:)
|
|
153
|
+
# Skip existence check if path is already in load_paths
|
|
154
|
+
# This allows multiple classes from the same file to be registered
|
|
142
155
|
return false if load_paths.include?(plugin_path)
|
|
143
156
|
|
|
144
157
|
base = plugin_class.superclass.name
|
data/lib/fusuma/version.rb
CHANGED
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.11.1
|
|
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: 2026-01-10 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
|