fusuma 0.3.5 → 0.3.7

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
  SHA1:
3
- metadata.gz: 34ecf279d76838ff817767328b76558273a56504
4
- data.tar.gz: bf0aa51f796c7beb50e8a2ebc9a291700f39042a
3
+ metadata.gz: 7f719afc170aa08c1023728ae58f00f769a2d1df
4
+ data.tar.gz: 5dc2ed61e4eae799af55db3ebbadaedad68452ed
5
5
  SHA512:
6
- metadata.gz: 2b7c17545e6655bfba041d1ef4917fae35ea4c2db40b74c9eb8a9de553952994ebb25de6bcce503cefb6495d72ee9fb20ac630a89a7c1ec05150eb0f32dec334
7
- data.tar.gz: 0d1eeb2f783b3b4cd64d05c9368c8c3710d9d8e636436baba54cad0b6160bd932f25ca187d2370e421c827ef7587ed8ee565a76b7fb329c3c852ceb18761416a
6
+ metadata.gz: b7cb5c250d0ae33c0d7699a50f837a578476e8c38d5b5d0c64d3e27e660f7905c3000f45ef921aacda1252021a8280a0c0ed68886bcda42d5bc2df98f422127c
7
+ data.tar.gz: b95463eaeb8c2c363eb8702df14416c79563a7595fe1ca86f1f4d8857b2a27d7d953f253fd901aa57816dde5332343b252b95e6f264d870ea17dac885f39cc3e
@@ -0,0 +1,18 @@
1
+ # Number of days of inactivity before an issue becomes stale
2
+ daysUntilStale: 60
3
+ # Number of days of inactivity before a stale issue is closed
4
+ daysUntilClose: 7
5
+ # Issues with these labels will never be considered stale
6
+ exemptLabels:
7
+ - pinned
8
+ - security
9
+ # Label to use when marking an issue as stale
10
+ staleLabel: wontfix
11
+ # Comment to post when marking an issue as stale. Set to `false` to disable
12
+ markComment: >
13
+ This issue has been automatically marked as stale because it has not had
14
+ recent activity. It will be closed if no further activity occurs. Thank you
15
+ for your contributions.
16
+ # Comment to post when closing a stale issue. Set to `false` to disable
17
+ closeComment: false
18
+
@@ -4,4 +4,6 @@ rvm:
4
4
  - 2.1
5
5
  - 2.2
6
6
  - 2.3.1
7
+ - 2.4
8
+ - 2.5
7
9
  before_install: gem install bundler -v 1.13.2
data/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # Fusuma [![Gem Version](https://badge.fury.io/rb/fusuma.svg)](https://badge.fury.io/rb/fusuma) [![Build Status](https://travis-ci.org/iberianpig/fusuma.svg?branch=master)](https://travis-ci.org/iberianpig/fusuma)
2
2
 
3
3
  Fusuma is multitouch gesture recognizer.
4
- This gem makes your linux PC able to recognize swipes or pinchs and assign shortcuts to them.
4
+ This gem makes your linux PC able to recognize swipes or pinchs and assign commands to them.
5
5
 
6
6
  [![https://gyazo.com/757fef526310b9d68f68e80eb1e4540f](https://i.gyazo.com/757fef526310b9d68f68e80eb1e4540f.png)](https://gyazo.com/757fef526310b9d68f68e80eb1e4540f)
7
7
 
@@ -20,7 +20,7 @@ You need libinput release 1.0 or later. Install libinput-tools:
20
20
 
21
21
  $ sudo apt-get install libinput-tools
22
22
 
23
- For sending shortcuts:
23
+ For sending shortcuts(optional):
24
24
 
25
25
  $ sudo apt-get install xdotool
26
26
 
@@ -47,8 +47,15 @@ Ensure the touchpad events are being sent to the GNOME desktop by running the fo
47
47
  You can customize the settings for gestures to put and edit `~/.config/fusuma/config.yml`.
48
48
  *NOTE*: You will need to create the `~/.config/fusuma` directory if it doesn't exist yet.
49
49
 
50
+ ### `Command: ` property
51
+ On fusuma version 1.0 `Command: ` property is available!
52
+ You can assign any command each gestures.
50
53
 
51
- ### Sample (default keymap for Elementary OS)
54
+ **`shortcut: ` property is deprecated**, **it will be removed on fusuma version 1.0**.
55
+ You need to replace to `command: ` property.
56
+
57
+
58
+ #### before
52
59
 
53
60
  ```yaml
54
61
  swipe:
@@ -57,24 +64,46 @@ swipe:
57
64
  shortcut: 'alt+Left'
58
65
  right:
59
66
  shortcut: 'alt+Right'
67
+ ```
68
+
69
+ #### after
70
+
71
+ ```yaml
72
+ swipe:
73
+ 3:
74
+ left:
75
+ command: 'xdotool key alt+Left'
76
+ right:
77
+ command: 'xdotool key alt+Right'
78
+ ```
79
+
80
+ ### Sample (default keymap for Elementary OS)
81
+
82
+ ```yaml
83
+ swipe:
84
+ 3:
85
+ left:
86
+ command: 'xdotool key alt+Left'
87
+ right:
88
+ command: 'xdotool key alt+Right'
60
89
  up:
61
- shortcut: 'ctrl+t'
90
+ command: 'xdotool key ctrl+t'
62
91
  down:
63
- shortcut: 'ctrl+w'
92
+ command: 'xdotool key ctrl+w'
64
93
  4:
65
94
  left:
66
- shortcut: 'super+Left'
95
+ command: 'xdotool key super+Left'
67
96
  right:
68
- shortcut: 'super+Right'
97
+ command: 'xdotool key super+Right'
69
98
  up:
70
- shortcut: 'super+a'
99
+ command: 'xdotool key super+a'
71
100
  down:
72
- shortcut: 'super+s'
101
+ command: 'xdotool key super+s'
73
102
  pinch:
74
103
  in:
75
- shortcut: 'ctrl+plus'
104
+ command: 'xdotool key ctrl+plus'
76
105
  out:
77
- shortcut: 'ctrl+minus'
106
+ command: 'xdotool key ctrl+minus'
78
107
 
79
108
  threshold:
80
109
  swipe: 1
@@ -85,7 +114,7 @@ interval:
85
114
  pinch: 1
86
115
  ```
87
116
 
88
- if `shortcut: ` is blank, the swipe/pinch doesn't trigger a keyevent.
117
+ if `command: ` properties are blank, the swipe/pinch doesn't trigger command.
89
118
 
90
119
  `threshold:` is sensitivity to swipe/pinch. Default value is 1.
91
120
  If the swipe's threshold is `0.5`, shorten swipe-length by half.
data/exe/fusuma CHANGED
@@ -12,8 +12,8 @@ OptionParser.new do |opt|
12
12
  end
13
13
  opt.on('-c',
14
14
  '--config=path/to/file',
15
- 'Use an alternative config file') do |v|
16
- option[:config] = v
15
+ 'Use an alternative config file') do |c|
16
+ option[:config] = c
17
17
  end
18
18
  opt.parse!(ARGV)
19
19
  end
@@ -22,7 +22,7 @@ Gem::Specification.new do |spec|
22
22
  spec.require_paths = ['lib']
23
23
 
24
24
  spec.add_development_dependency 'bundler', '~> 1.13'
25
- spec.add_development_dependency 'rake', '~> 10.0'
25
+ spec.add_development_dependency 'rake', '~> 12.3'
26
26
  spec.add_development_dependency 'rspec', '~> 3.0'
27
27
  spec.add_development_dependency 'pry'
28
28
  spec.add_development_dependency 'pry-byebug'
@@ -1,7 +1,7 @@
1
1
  require_relative 'fusuma/version'
2
2
  require_relative 'fusuma/action_stack'
3
3
  require_relative 'fusuma/gesture_action'
4
- require_relative 'fusuma/gesture_info'
4
+ require_relative 'fusuma/event_trigger'
5
5
  require_relative 'fusuma/swipe.rb'
6
6
  require_relative 'fusuma/pinch.rb'
7
7
  require_relative 'fusuma/multi_logger'
@@ -40,8 +40,8 @@ module Fusuma
40
40
  next if gesture_action.nil?
41
41
  @action_stack ||= ActionStack.new
42
42
  @action_stack.push gesture_action
43
- gesture_info = @action_stack.gesture_info
44
- gesture_info.trigger_keyevent unless gesture_info.nil?
43
+ event_trigger = @action_stack.generate_event_trigger
44
+ event_trigger.send_command unless event_trigger.nil?
45
45
  end
46
46
  end
47
47
  end
@@ -7,7 +7,7 @@ module Fusuma
7
7
  super(*args)
8
8
  end
9
9
 
10
- def gesture_info
10
+ def generate_event_trigger
11
11
  return unless enough_actions?
12
12
  action_type = detect_action_type
13
13
  direction = detect_direction(action_type)
@@ -15,7 +15,7 @@ module Fusuma
15
15
  @last_triggered_time = last.time
16
16
  finger = detect_finger
17
17
  clear
18
- GestureInfo.new(finger, direction, action_type)
18
+ EventTrigger.new(finger, direction, action_type)
19
19
  end
20
20
 
21
21
  def push(gesture_action)
@@ -6,8 +6,12 @@ module Fusuma
6
6
  include Singleton
7
7
 
8
8
  class << self
9
- def shortcut(gesture_info)
10
- instance.shortcut(gesture_info)
9
+ def command(event_trigger)
10
+ instance.command(event_trigger)
11
+ end
12
+
13
+ def shortcut(event_trigger)
14
+ instance.shortcut(event_trigger)
11
15
  end
12
16
 
13
17
  def threshold(action_type)
@@ -37,8 +41,13 @@ module Fusuma
37
41
  self
38
42
  end
39
43
 
40
- def shortcut(gesture_info)
41
- seek_index = [*action_index(gesture_info), 'shortcut']
44
+ def command(event_trigger)
45
+ seek_index = [*action_index(event_trigger), 'command']
46
+ cache(seek_index) { search_config(keymap, seek_index) }
47
+ end
48
+
49
+ def shortcut(event_trigger)
50
+ seek_index = [*action_index(event_trigger), 'shortcut']
42
51
  cache(seek_index) { search_config(keymap, seek_index) }
43
52
  end
44
53
 
@@ -89,10 +98,10 @@ module Fusuma
89
98
  File.expand_path "../../#{filename}", __FILE__
90
99
  end
91
100
 
92
- def action_index(gesture_info)
93
- action_type = gesture_info.action_type
94
- finger = gesture_info.finger
95
- direction = gesture_info.direction
101
+ def action_index(event_trigger)
102
+ action_type = event_trigger.action_type
103
+ finger = event_trigger.finger
104
+ direction = event_trigger.direction
96
105
  [action_type, finger, direction]
97
106
  end
98
107
 
@@ -1,31 +1,31 @@
1
1
  swipe:
2
2
  3:
3
3
  left:
4
- shortcut: 'alt+Left'
4
+ command: 'xdotool key alt+Right'
5
5
  right:
6
- shortcut: 'alt+Right'
6
+ command: 'xdotool key alt+Left'
7
7
  up:
8
- shortcut: 'ctrl+t'
8
+ command: 'xdotool key ctrl+t'
9
9
  down:
10
- shortcut: 'ctrl+w'
10
+ command: 'xdotool key ctrl+w'
11
11
  4:
12
12
  left:
13
- shortcut: 'super+Left'
13
+ command: 'xdotool key super+Right'
14
14
  right:
15
- shortcut: 'super+Right'
15
+ command: 'xdotool key super+Left'
16
16
  up:
17
- shortcut: 'super+a'
17
+ command: 'xdotool key super+a'
18
18
  down:
19
- shortcut: 'super+s'
19
+ command: 'xdotool key super+s'
20
20
  pinch:
21
21
  in:
22
- shortcut: 'ctrl+plus'
22
+ command: 'xdotool key ctrl+plus'
23
23
  out:
24
- shortcut: 'ctrl+minus'
24
+ command: 'xdotool key ctrl+minus'
25
25
 
26
26
  threshold:
27
- swipe: 1
28
- pinch: 1
27
+ swipe: 0.3
28
+ pinch: 0.1
29
29
 
30
30
  interval:
31
31
  swipe: 1
@@ -1,6 +1,6 @@
1
1
  module Fusuma
2
2
  # manage actions
3
- class GestureInfo
3
+ class EventTrigger
4
4
  def initialize(finger, direction, action_type)
5
5
  @finger = finger.to_i
6
6
  @direction = direction
@@ -8,19 +8,19 @@ module Fusuma
8
8
  end
9
9
  attr_reader :finger, :direction, :action_type
10
10
 
11
- def trigger_keyevent
12
- MultiLogger.info("trigger keyevent: #{shortcut}")
13
- exec_xdotool(shortcut)
11
+ def send_command
12
+ MultiLogger.info("trigger event: #{command}")
13
+ exec_command(command)
14
14
  end
15
15
 
16
16
  private
17
17
 
18
- def exec_xdotool(keys)
19
- `xdotool key #{keys}` unless keys.nil?
18
+ def exec_command(command)
19
+ `#{command}` unless command.nil?
20
20
  end
21
21
 
22
- def shortcut
23
- Config.shortcut(self)
22
+ def command
23
+ Config.command(self) || "xdotool key #{Config.shortcut(self)}"
24
24
  end
25
25
  end
26
26
  end
@@ -1,3 +1,3 @@
1
1
  module Fusuma
2
- VERSION = '0.3.5'.freeze
2
+ VERSION = '0.3.7'.freeze
3
3
  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: 0.3.5
4
+ version: 0.3.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - iberianpig
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-01-01 00:00:00.000000000 Z
11
+ date: 2018-04-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '10.0'
33
+ version: '12.3'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '10.0'
40
+ version: '12.3'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rspec
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -118,6 +118,7 @@ executables:
118
118
  extensions: []
119
119
  extra_rdoc_files: []
120
120
  files:
121
+ - ".github/stale.yml"
121
122
  - ".gitignore"
122
123
  - ".rspec"
123
124
  - ".rubocop.yml"
@@ -137,8 +138,8 @@ files:
137
138
  - lib/fusuma/config.rb
138
139
  - lib/fusuma/config.yml
139
140
  - lib/fusuma/device.rb
141
+ - lib/fusuma/event_trigger.rb
140
142
  - lib/fusuma/gesture_action.rb
141
- - lib/fusuma/gesture_info.rb
142
143
  - lib/fusuma/multi_logger.rb
143
144
  - lib/fusuma/pinch.rb
144
145
  - lib/fusuma/swipe.rb
@@ -168,4 +169,3 @@ signing_key:
168
169
  specification_version: 4
169
170
  summary: Multitouch gestures with libinput dirver on X11, Linux
170
171
  test_files: []
171
- has_rdoc: