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 +4 -4
- data/.github/stale.yml +18 -0
- data/.travis.yml +2 -0
- data/README.md +41 -12
- data/exe/fusuma +2 -2
- data/fusuma.gemspec +1 -1
- data/lib/fusuma.rb +3 -3
- data/lib/fusuma/action_stack.rb +2 -2
- data/lib/fusuma/config.rb +17 -8
- data/lib/fusuma/config.yml +12 -12
- data/lib/fusuma/{gesture_info.rb → event_trigger.rb} +8 -8
- data/lib/fusuma/version.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7f719afc170aa08c1023728ae58f00f769a2d1df
|
4
|
+
data.tar.gz: 5dc2ed61e4eae799af55db3ebbadaedad68452ed
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b7cb5c250d0ae33c0d7699a50f837a578476e8c38d5b5d0c64d3e27e660f7905c3000f45ef921aacda1252021a8280a0c0ed68886bcda42d5bc2df98f422127c
|
7
|
+
data.tar.gz: b95463eaeb8c2c363eb8702df14416c79563a7595fe1ca86f1f4d8857b2a27d7d953f253fd901aa57816dde5332343b252b95e6f264d870ea17dac885f39cc3e
|
data/.github/stale.yml
ADDED
@@ -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
|
+
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# Fusuma [](https://badge.fury.io/rb/fusuma) [](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
|
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)
|
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
|
-
|
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
|
-
|
90
|
+
command: 'xdotool key ctrl+t'
|
62
91
|
down:
|
63
|
-
|
92
|
+
command: 'xdotool key ctrl+w'
|
64
93
|
4:
|
65
94
|
left:
|
66
|
-
|
95
|
+
command: 'xdotool key super+Left'
|
67
96
|
right:
|
68
|
-
|
97
|
+
command: 'xdotool key super+Right'
|
69
98
|
up:
|
70
|
-
|
99
|
+
command: 'xdotool key super+a'
|
71
100
|
down:
|
72
|
-
|
101
|
+
command: 'xdotool key super+s'
|
73
102
|
pinch:
|
74
103
|
in:
|
75
|
-
|
104
|
+
command: 'xdotool key ctrl+plus'
|
76
105
|
out:
|
77
|
-
|
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 `
|
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
data/fusuma.gemspec
CHANGED
@@ -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', '~>
|
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'
|
data/lib/fusuma.rb
CHANGED
@@ -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/
|
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
|
-
|
44
|
-
|
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
|
data/lib/fusuma/action_stack.rb
CHANGED
@@ -7,7 +7,7 @@ module Fusuma
|
|
7
7
|
super(*args)
|
8
8
|
end
|
9
9
|
|
10
|
-
def
|
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
|
-
|
18
|
+
EventTrigger.new(finger, direction, action_type)
|
19
19
|
end
|
20
20
|
|
21
21
|
def push(gesture_action)
|
data/lib/fusuma/config.rb
CHANGED
@@ -6,8 +6,12 @@ module Fusuma
|
|
6
6
|
include Singleton
|
7
7
|
|
8
8
|
class << self
|
9
|
-
def
|
10
|
-
instance.
|
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
|
41
|
-
seek_index = [*action_index(
|
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(
|
93
|
-
action_type =
|
94
|
-
finger =
|
95
|
-
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
|
|
data/lib/fusuma/config.yml
CHANGED
@@ -1,31 +1,31 @@
|
|
1
1
|
swipe:
|
2
2
|
3:
|
3
3
|
left:
|
4
|
-
|
4
|
+
command: 'xdotool key alt+Right'
|
5
5
|
right:
|
6
|
-
|
6
|
+
command: 'xdotool key alt+Left'
|
7
7
|
up:
|
8
|
-
|
8
|
+
command: 'xdotool key ctrl+t'
|
9
9
|
down:
|
10
|
-
|
10
|
+
command: 'xdotool key ctrl+w'
|
11
11
|
4:
|
12
12
|
left:
|
13
|
-
|
13
|
+
command: 'xdotool key super+Right'
|
14
14
|
right:
|
15
|
-
|
15
|
+
command: 'xdotool key super+Left'
|
16
16
|
up:
|
17
|
-
|
17
|
+
command: 'xdotool key super+a'
|
18
18
|
down:
|
19
|
-
|
19
|
+
command: 'xdotool key super+s'
|
20
20
|
pinch:
|
21
21
|
in:
|
22
|
-
|
22
|
+
command: 'xdotool key ctrl+plus'
|
23
23
|
out:
|
24
|
-
|
24
|
+
command: 'xdotool key ctrl+minus'
|
25
25
|
|
26
26
|
threshold:
|
27
|
-
swipe:
|
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
|
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
|
12
|
-
MultiLogger.info("trigger
|
13
|
-
|
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
|
19
|
-
|
18
|
+
def exec_command(command)
|
19
|
+
`#{command}` unless command.nil?
|
20
20
|
end
|
21
21
|
|
22
|
-
def
|
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
|
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: 0.3.
|
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-
|
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: '
|
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: '
|
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:
|