fusuma 1.8.0 → 1.9.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a67f3ff722cd13d72966f7be8d0292485fcbdc3e72e83914222f762deb4ab37a
4
- data.tar.gz: c315fe56fd0d005dd8629ef39cb4405b53bf2e98cba6c1517de750415cf9dd7a
3
+ metadata.gz: 93c6c3c71411a7eebb99751019f6644162214db4f26905bb5d3b1bd7eb6da917
4
+ data.tar.gz: ce95d881ac734359d79dba87fc25dfc72a43ef7f4e50ed23b0ca0478883f405c
5
5
  SHA512:
6
- metadata.gz: a76b5174dd2a568db4b391797fbcb1c3e239a041f69c9399b49969de81b072b3ebf09829182e30829231ca38f52ff84c6966d807b1616eb3ccce6c43e564ad7a
7
- data.tar.gz: 811f35941e58962311d9d67448b25d422760f7779678f377c3cbd35b4e89dc197dfb2ee237ac033e654312f1c25261bc8dc1d00fb2d466b3594b4b348fd66b04
6
+ metadata.gz: 85b9bccb20dd58f97407d7d0955e9fbf378cc1c23f7ccb502f8ae48920faefacbf2dfd2b2fa374de3fbb237d68f0c92207a83e391e0aaab7783853270a98328b
7
+ data.tar.gz: 2a7cb2e707712d4c4a78e40e641137bb906adf8dbe21d2105cc7c293255f3e5a838f658fc85377a8c12de80f74211443a4bc513cbd4608dc9c611fe9929a9e5e
@@ -1,8 +1,8 @@
1
1
  # Changelog
2
2
 
3
- ## [Unreleased](https://github.com/iberianpig/fusuma/tree/HEAD)
3
+ ## [v1.8.0](https://github.com/iberianpig/fusuma/tree/v1.8.0) (2020-03-28)
4
4
 
5
- [Full Changelog](https://github.com/iberianpig/fusuma/compare/v1.7.0...HEAD)
5
+ [Full Changelog](https://github.com/iberianpig/fusuma/compare/v1.7.0...v1.8.0)
6
6
 
7
7
  **Implemented enhancements:**
8
8
 
@@ -12,6 +12,11 @@
12
12
 
13
13
  - When xdotool acts crazy. Workaround should be clearly informed. [\#146](https://github.com/iberianpig/fusuma/issues/146)
14
14
 
15
+ **Merged pull requests:**
16
+
17
+ - Fix cops [\#158](https://github.com/iberianpig/fusuma/pull/158) ([iberianpig](https://github.com/iberianpig))
18
+ - Add ruby 2.7 to .travis.yml [\#157](https://github.com/iberianpig/fusuma/pull/157) ([iberianpig](https://github.com/iberianpig))
19
+
15
20
  ## [v1.7.0](https://github.com/iberianpig/fusuma/tree/v1.7.0) (2020-03-25)
16
21
 
17
22
  [Full Changelog](https://github.com/iberianpig/fusuma/compare/v1.6.0...v1.7.0)
@@ -147,6 +152,7 @@
147
152
 
148
153
  - Interval and threshold specific for a trigger [\#92](https://github.com/iberianpig/fusuma/pull/92) ([irq](https://github.com/irq))
149
154
  - Fix spelling: Elementary to elementary [\#90](https://github.com/iberianpig/fusuma/pull/90) ([ryonakano](https://github.com/ryonakano))
155
+ - Assigning commands [\#73](https://github.com/iberianpig/fusuma/pull/73) ([iberianpig](https://github.com/iberianpig))
150
156
 
151
157
  ## [v0.9.2](https://github.com/iberianpig/fusuma/tree/v0.9.2) (2018-07-19)
152
158
 
@@ -235,7 +241,6 @@
235
241
 
236
242
  **Merged pull requests:**
237
243
 
238
- - Assigning commands [\#73](https://github.com/iberianpig/fusuma/pull/73) ([iberianpig](https://github.com/iberianpig))
239
244
  - Update rake requirement to ~\> 12.3 [\#72](https://github.com/iberianpig/fusuma/pull/72) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview))
240
245
 
241
246
  ## [v0.3.5](https://github.com/iberianpig/fusuma/tree/v0.3.5) (2018-01-01)
@@ -279,10 +284,6 @@
279
284
  - parse\_finger\_directions: undefined method `tr' for nil:NilClass \(NoMethodError\) [\#29](https://github.com/iberianpig/fusuma/issues/29)
280
285
  - Error after upgrading to libinput 1.6.0 [\#26](https://github.com/iberianpig/fusuma/issues/26)
281
286
 
282
- **Merged pull requests:**
283
-
284
- - Added interval options to config. [\#36](https://github.com/iberianpig/fusuma/pull/36) ([joshuatshaffer](https://github.com/joshuatshaffer))
285
-
286
287
  ## [v0.2.7](https://github.com/iberianpig/fusuma/tree/v0.2.7) (2017-02-04)
287
288
 
288
289
  [Full Changelog](https://github.com/iberianpig/fusuma/compare/v0.2.6...v0.2.7)
@@ -293,6 +294,7 @@
293
294
 
294
295
  **Merged pull requests:**
295
296
 
297
+ - Added interval options to config. [\#36](https://github.com/iberianpig/fusuma/pull/36) ([joshuatshaffer](https://github.com/joshuatshaffer))
296
298
  - update parser [\#30](https://github.com/iberianpig/fusuma/pull/30) ([iberianpig](https://github.com/iberianpig))
297
299
 
298
300
  ## [v0.2.6](https://github.com/iberianpig/fusuma/tree/v0.2.6) (2017-01-22)
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Fusuma [![Gem Version](https://badge.fury.io/rb/fusuma.svg)](https://badge.fury.io/rb/fusuma) [![Build Status](https://travis-ci.com/iberianpig/fusuma.svg?branch=master)](https://travis-ci.com/iberianpig/fusuma)
1
+ # Fusuma [![Gem Version](https://badge.fury.io/rb/fusuma.svg)](https://badge.fury.io/rb/fusuma) [![Build Status](https://travis-ci.com/iberianpig/fusuma.svg?branch=master)](https://travis-ci.com/iberianpig/fusuma) [![Coverage Status](https://coveralls.io/repos/github/iberianpig/fusuma/badge.svg?branch=master)](https://coveralls.io/github/iberianpig/fusuma?branch=master) [![Inline docs](http://inch-ci.org/github/iberianpig/fusuma.svg?branch=master)](http://inch-ci.org/github/iberianpig/fusuma)
2
2
 
3
3
  Fusuma is multitouch gesture recognizer.
4
4
  This gem makes your linux able to recognize swipes or pinchs and assign commands to them.
@@ -181,9 +181,21 @@ swipe:
181
181
  * `-d`, `--daemon` : Daemonize process
182
182
  * `-l`, `--list-devices` : List available devices
183
183
  * `-v`, `--verbose` : Show details about the results of running fusuma
184
- * `--device="Device name"` : Open the given device only
184
+ * `--device="Device name"` : Open the given device only (DEPRECATED)
185
185
  * `--version` : Show fusuma version
186
186
 
187
+ ### Filter Device
188
+
189
+ Set the following options to recognize multi-touch gestures only for the specified touchpad device.
190
+
191
+ ```yaml
192
+ plugin:
193
+ filters:
194
+ libinput_device_filter:
195
+ keep_device_names:
196
+ - "DEVICE NAME"
197
+ ```
198
+
187
199
  ## Autostart (gnome-session-properties)
188
200
  1. Check the path where you installed fusuma with `$ which fusuma`
189
201
  2. Open `$ gnome-session-properties`
data/exe/fusuma CHANGED
@@ -23,7 +23,7 @@ opt.on('-l', '--list-devices',
23
23
  end
24
24
 
25
25
  opt.on('--device="Device name"',
26
- 'Open the given device only') do |v|
26
+ 'Open the given device only (DEPRECATED)') do |v|
27
27
  option[:device] = v
28
28
  end
29
29
 
@@ -25,6 +25,7 @@ Gem::Specification.new do |spec|
25
25
 
26
26
  spec.required_ruby_version = '>= 2.3' # https://packages.ubuntu.com/search?keywords=ruby&searchon=names&exact=1&suite=all&section=main
27
27
  spec.add_development_dependency 'bundler'
28
+ spec.add_development_dependency "coveralls"
28
29
  spec.add_development_dependency 'github_changelog_generator', '~> 1.14'
29
30
  spec.add_development_dependency 'pry-byebug', '~> 3.4'
30
31
  spec.add_development_dependency 'pry-doc'
@@ -3,8 +3,7 @@
3
3
  require_relative './fusuma/version'
4
4
  require_relative './fusuma/multi_logger'
5
5
  require_relative './fusuma/config.rb'
6
- require_relative './fusuma/device.rb'
7
- require_relative './fusuma/libinput_command.rb'
6
+ require_relative './fusuma/environment.rb'
8
7
  require_relative './fusuma/plugin/manager.rb'
9
8
 
10
9
  # this is top level module
@@ -33,38 +32,18 @@ module Fusuma
33
32
 
34
33
  Plugin::Manager.require_base_plugins
35
34
 
36
- MultiLogger.info '---------------------------------------------'
37
- print_version
38
- MultiLogger.info '---------------------------------------------'
39
- print_enabled_plugins
40
- MultiLogger.info '---------------------------------------------'
35
+ Environment.dump_information
41
36
  Kernel.exit(0) if option[:version]
42
37
 
43
- print_device_list if option[:list]
38
+ if option[:list]
39
+ Environment.print_device_list
40
+ Kernel.exit(0)
41
+ end
42
+
44
43
  # TODO: remove keep_device_from_option from command line options
45
44
  Plugin::Filters::LibinputDeviceFilter::KeepDevice.from_option = option[:device]
46
- Process.daemon if option[:daemon]
47
- end
48
45
 
49
- def print_version
50
- MultiLogger.info "Fusuma: #{Fusuma::VERSION}"
51
- MultiLogger.info "libinput: #{LibinputCommand.new.version}"
52
- MultiLogger.info "OS: #{`uname -rsv`}".strip
53
- MultiLogger.info "Distribution: #{`cat /etc/issue`}".strip
54
- MultiLogger.info "Desktop session: #{`echo $DESKTOP_SESSION $XDG_SESSION_TYPE`}".strip
55
- end
56
-
57
- def print_enabled_plugins
58
- MultiLogger.info 'Enabled Plugins: '
59
- Plugin::Manager.plugins
60
- .reject { |k, _v| k.to_s =~ /Base/ }
61
- .map { |_base, plugins| plugins.map { |plugin| " #{plugin}" } }
62
- .flatten.sort.each { |name| MultiLogger.info(name) }
63
- end
64
-
65
- def print_device_list
66
- puts Device.available.map(&:name)
67
- exit(0)
46
+ Process.daemon if option[:daemon]
68
47
  end
69
48
 
70
49
  def load_custom_config(config_path = nil)
@@ -86,7 +65,7 @@ module Fusuma
86
65
  def run
87
66
  # TODO: run with multi thread
88
67
  @inputs.first.run do |event|
89
- clear_expired
68
+ clear_expired_events
90
69
  filtered = filter(event) || next
91
70
  parsed = parse(filtered) || next
92
71
  buffered = buffer(parsed) || next
@@ -139,7 +118,7 @@ module Fusuma
139
118
  executor&.execute(event)
140
119
  end
141
120
 
142
- def clear_expired
121
+ def clear_expired_events
143
122
  @buffers.each(&:clear_expired)
144
123
  end
145
124
  end
@@ -0,0 +1,42 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative './version.rb'
4
+ require_relative './libinput_command.rb'
5
+ require_relative './multi_logger.rb'
6
+
7
+ module Fusuma
8
+ # Output Environment information
9
+ class Environment
10
+ class << self
11
+ def dump_information
12
+ MultiLogger.info '---------------------------------------------'
13
+ print_version
14
+ MultiLogger.info '---------------------------------------------'
15
+ print_enabled_plugins
16
+ MultiLogger.info '---------------------------------------------'
17
+ end
18
+
19
+ def print_version
20
+ MultiLogger.info "Fusuma: #{VERSION}"
21
+ MultiLogger.info "libinput: #{LibinputCommand.new.version}"
22
+ MultiLogger.info "OS: #{`uname -rsv`}".strip
23
+ MultiLogger.info "Distribution: #{`cat /etc/issue`}".strip
24
+ MultiLogger.info "Desktop session: #{`echo $DESKTOP_SESSION $XDG_SESSION_TYPE`}".strip
25
+ end
26
+
27
+ def print_enabled_plugins
28
+ MultiLogger.info 'Enabled Plugins: '
29
+ Plugin::Manager.plugins
30
+ .reject { |k, _v| k.to_s =~ /Base/ }
31
+ .map { |_base, plugins| plugins.map { |plugin| " #{plugin}" } }
32
+ .flatten.sort.each { |name| MultiLogger.info(name) }
33
+ end
34
+
35
+ def print_device_list
36
+ Plugin::Filters::LibinputDeviceFilter.new.keep_device.all.map do |device|
37
+ puts device.name
38
+ end
39
+ end
40
+ end
41
+ end
42
+ end
@@ -36,12 +36,26 @@ module Fusuma
36
36
  end
37
37
  end
38
38
 
39
+ def config_param_sample
40
+ <<~SAMPLE
41
+ ```config.yml
42
+ plugin:
43
+ filters:
44
+ libinput_device_filter:
45
+ keep_device_names:
46
+ - "DEVICE NAME PATTERN"
47
+ ```
48
+ SAMPLE
49
+ end
50
+
39
51
  # Select Device to keep
40
52
  class KeepDevice
41
53
  def initialize(name_patterns:)
42
54
  @name_patterns = name_patterns | Array(self.class.from_option)
43
55
  end
44
56
 
57
+ attr_reader :name_patterns
58
+
45
59
  # remove cache for reloading new devices
46
60
  def reset
47
61
  @all = nil
@@ -56,9 +70,16 @@ module Fusuma
56
70
  Device.all.select do |device|
57
71
  match_pattern?(device.name)
58
72
  end
73
+ end.tap do |devices|
74
+ print_not_found_messages if devices.empty?
59
75
  end
60
76
  end
61
77
 
78
+ def print_not_found_messages
79
+ puts 'Device is not found. Check following section on your config.yml'
80
+ puts LibinputDeviceFilter.new.config_param_sample
81
+ end
82
+
62
83
  # @return [TrueClass]
63
84
  # @return [FalseClass]
64
85
  def match_pattern?(string)
@@ -68,8 +89,20 @@ module Fusuma
68
89
  end
69
90
 
70
91
  class << self
92
+ attr_reader :from_option
93
+
71
94
  # TODO: remove from_option and command line options
72
- attr_accessor :from_option
95
+ def from_option=(device)
96
+ if device
97
+ warn <<~COMMENT
98
+ Don't use --device="Device name" option because it is deprecated.
99
+ Use the options below instead.
100
+
101
+ #{LibinputDeviceFilter.new.config_param_sample}
102
+ COMMENT
103
+ end
104
+ @from_option = device
105
+ end
73
106
  end
74
107
  end
75
108
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Fusuma
4
- VERSION = '1.8.0'
4
+ VERSION = '1.9.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.8.0
4
+ version: 1.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: 2020-03-28 00:00:00.000000000 Z
11
+ date: 2020-03-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -24,6 +24,20 @@ dependencies:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: coveralls
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: github_changelog_generator
29
43
  requirement: !ruby/object:Gem::Requirement
@@ -185,6 +199,7 @@ files:
185
199
  - lib/fusuma/config.yml
186
200
  - lib/fusuma/config/index.rb
187
201
  - lib/fusuma/device.rb
202
+ - lib/fusuma/environment.rb
188
203
  - lib/fusuma/libinput_command.rb
189
204
  - lib/fusuma/multi_logger.rb
190
205
  - lib/fusuma/plugin/base.rb
@@ -229,7 +244,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
229
244
  - !ruby/object:Gem::Version
230
245
  version: '0'
231
246
  requirements: []
232
- rubygems_version: 3.1.2
247
+ rubygems_version: 3.0.3
233
248
  signing_key:
234
249
  specification_version: 4
235
250
  summary: Multitouch gestures with libinput dirver on X11, Linux