fusuma 1.5.0 → 1.6.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: ce8f9acb74d456ca14afae7b7cf83fa70e2c52adc81902e2e0eb7f1ff1d1c6aa
4
- data.tar.gz: 121e54c98da13699bae297fea522f8004a73de33e438ffb9fd6161fb7b6df069
3
+ metadata.gz: 65e85c17ee616861de23dfda299da1de324ebc4dd26aad155d6154641b81e332
4
+ data.tar.gz: f8516a7ac078ee2d600e23ebcfb2420a36a12810ded08538ee5ed178baa05283
5
5
  SHA512:
6
- metadata.gz: ce1727335f611a3d9ee099b8189bbf4e80d7f446173b696f46c1cada8b7185d19811a4227c73d3216e7e5a949bdfd838c7a5e1757351417642906b885cba383a
7
- data.tar.gz: 0347fc47ef4ababac2b591156523c933fad9b045d8d76889d627ced6be0720a8719f69a4d02c2fff0ac94cb46eed5a77a16a117486cc0e9764ab4ee833f99f7f
6
+ metadata.gz: fac1ec6baaeb39f8e9ecd2c883b4db02cda3b2afb3f16b832ec6b5a8219dc902a0c8df68f432aa2f78b240d588f2f2734fd92e7368c7372394ab9432251ee7f7
7
+ data.tar.gz: 24d8e5d474fcbd318d2b8027110291585dfa71878f5e329b97d2e4f935edb1f37ae0a11d3d7bb330fdd2458d001f1da1e27022ea416bddaf96cb78a33a01cfe9
data/README.md CHANGED
@@ -68,7 +68,7 @@ $ sudo gem update fusuma
68
68
 
69
69
  ## Customize Gesture Mapping
70
70
 
71
- You can customize the settings for gestures to put and edit `~/.config/fusuma/config.yml`.
71
+ You can customize the settings for gestures to put and edit `~/.config/fusuma/config.yml`.
72
72
  **NOTE: You will need to create the `~/.config/fusuma` directory if it doesn't exist yet.**
73
73
 
74
74
  ```bash
@@ -191,13 +191,23 @@ swipe:
191
191
 
192
192
  ### About xdotool
193
193
 
194
+
194
195
  * xdotool manual (https://github.com/jordansissel/xdotool/blob/master/xdotool.pod)
195
196
  * Available keys' hint (https://github.com/jordansissel/xdotool/issues/212#issuecomment-406156157)
196
197
 
197
- * `xte` command is alternative of xdotool
198
- * Low delay with multiple keyboard layout
199
- * install with `sudo apt xautomation`
200
- * manual https://linux.die.net/man/1/xte
198
+ **NOTE: xdotool has some issues**
199
+
200
+ * Gestures take a few seconds to react(https://github.com/iberianpig/fusuma/issues/113)
201
+
202
+ #### Alternatives to xdotool
203
+
204
+ * [fusuma-plugin-sendkey](https://github.com/iberianpig/fusuma-plugin-sendkey)
205
+ * Emulates keyboard events
206
+ * Wayland compatible
207
+
208
+ * `xte`
209
+ * [xte(1) - Linux man page](https://linux.die.net/man/1/xte)
210
+ * install with `sudo apt xautomation`
201
211
 
202
212
  ## Options
203
213
 
@@ -218,9 +228,8 @@ swipe:
218
228
 
219
229
  Following features are provided as plugins.
220
230
 
221
- * Experimental features
222
- * Features for specific Linux distributions
223
231
  * Adding new gestures or combinations
232
+ * Features for specific Linux distributions
224
233
  * Setting different gestures per applications
225
234
 
226
235
  ### Installation of fusuma plugins
@@ -231,10 +240,11 @@ Fusuma plugins are provided with the `fusuma-plugin-XXXXX` naming convention and
231
240
 
232
241
  ### Available plugins
233
242
 
234
- | Name | Author | About |
235
- |--------------------------------------------------------------------------------|------------|----------------------------------------|
236
- | [fusuma-plugin-wmctrl](https://github.com/iberianpig/fusuma-plugin-wmctrl) | iberianpig | Window Manager plugin for Fusuma |
237
- | [fusuma-plugin-keypress](https://github.com/iberianpig/fusuma-plugin-keypress) | iberianpig | Keypress combination plugin for Fusuma |
243
+ | Name | About |
244
+ |--------------------------------------------------------------------------------|-----------------------------------------------|
245
+ | [fusuma-plugin-sendkey](https://github.com/iberianpig/fusuma-plugin-sendkey) | Emulates keyboard events |
246
+ | [fusuma-plugin-wmctrl](https://github.com/iberianpig/fusuma-plugin-wmctrl) | Manages Window and Workspace |
247
+ | [fusuma-plugin-keypress](https://github.com/iberianpig/fusuma-plugin-keypress) | Detects gestures while pressing multiple keys |
238
248
 
239
249
  ## Support
240
250
 
data/lib/fusuma.rb CHANGED
@@ -31,7 +31,6 @@ module Fusuma
31
31
  load_custom_config(option[:config_path])
32
32
 
33
33
  Plugin::Manager.require_plugins_from_relative
34
- Plugin::Manager.require_plugins_from_config
35
34
 
36
35
  MultiLogger.info '---------------------------------------------'
37
36
  print_version
@@ -87,10 +86,10 @@ module Fusuma
87
86
  # TODO: run with multi thread
88
87
  @inputs.first.run do |event|
89
88
  clear_expired
90
- filtered = filter(event)
91
- parsed = parse(filtered)
92
- buffered = buffer(parsed)
93
- detected = detect(buffered)
89
+ filtered = filter(event) || next
90
+ parsed = parse(filtered) || next
91
+ buffered = buffer(parsed) || next
92
+ detected = detect(buffered) || next
94
93
  merged = merge(detected)
95
94
  execute(merged)
96
95
  end
@@ -105,7 +104,7 @@ module Fusuma
105
104
  end
106
105
 
107
106
  def buffer(event)
108
- @buffers.each { |b| b.buffer(event) }
107
+ @buffers.any? { |b| b.buffer(event) } && @buffers
109
108
  end
110
109
 
111
110
  # @param buffers [Array<Buffer>]
@@ -18,6 +18,7 @@ module Fusuma
18
18
  end
19
19
 
20
20
  # @param event [Event]
21
+ # @return [Buffer, false]
21
22
  def buffer(event)
22
23
  # TODO: buffering events into buffer plugins
23
24
  # - gesture event buffer
@@ -25,8 +26,13 @@ module Fusuma
25
26
  # - other event buffer
26
27
  return if event&.tag != source
27
28
 
28
- @events.push(event)
29
- clear unless updating?
29
+ if bufferable?(event)
30
+ @events.push(event)
31
+ self
32
+ else
33
+ clear
34
+ false
35
+ end
30
36
  end
31
37
 
32
38
  def clear_expired(current_time: Time.now)
@@ -77,10 +83,13 @@ module Fusuma
77
83
  self.class.new events
78
84
  end
79
85
 
80
- private
81
-
82
- def updating?
83
- return true unless @events.last.record.status =~ /begin|end/
86
+ def bufferable?(event)
87
+ case event.record.status
88
+ when 'begin', 'end'
89
+ false
90
+ else
91
+ true
92
+ end
84
93
  end
85
94
  end
86
95
  end
@@ -11,7 +11,7 @@ module Fusuma
11
11
  @plugin_class = plugin_class
12
12
  end
13
13
 
14
- def require_siblings_from_local
14
+ def require_siblings_from_plugin_dir
15
15
  search_key = File.join('../../', plugin_dir_name, '*.rb')
16
16
  Dir.glob(File.expand_path("#{__dir__}/#{search_key}")).sort.each do |siblings_plugin|
17
17
  require siblings_plugin
@@ -53,7 +53,7 @@ module Fusuma
53
53
  load_paths << plugin_path
54
54
 
55
55
  manager = Manager.new(plugin_class)
56
- manager.require_siblings_from_local
56
+ manager.require_siblings_from_plugin_dir
57
57
  manager.require_siblings_from_gems
58
58
  end
59
59
 
@@ -68,15 +68,6 @@ module Fusuma
68
68
  require_relative './executors/executor.rb'
69
69
  end
70
70
 
71
- def require_plugins_from_config
72
- local_plugin_paths = Config.search(Config::Index.new('local_plugin_paths'))
73
- return unless local_plugin_paths
74
-
75
- Array.new(local_plugin_paths).each do |plugin_path|
76
- require plugin_path
77
- end
78
- end
79
-
80
71
  def plugins
81
72
  @plugins ||= {}
82
73
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Fusuma
4
- VERSION = '1.5.0'
4
+ VERSION = '1.6.0'
5
5
  end
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: 1.5.0
4
+ version: 1.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - iberianpig
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-03-02 00:00:00.000000000 Z
11
+ date: 2020-03-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -228,7 +228,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
228
228
  - !ruby/object:Gem::Version
229
229
  version: '0'
230
230
  requirements: []
231
- rubygems_version: 3.0.6
231
+ rubygems_version: 3.0.3
232
232
  signing_key:
233
233
  specification_version: 4
234
234
  summary: Multitouch gestures with libinput dirver on X11, Linux