fusuma 0.1.7 → 0.1.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -0
- data/exe/fusuma +12 -2
- data/lib/fusuma.rb +6 -21
- data/lib/fusuma/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9e54f849efbfb11bcf56c129f310e9b12b34e6ee
|
4
|
+
data.tar.gz: 79fff6396e15de51fa7427b21cc92e58ab10aefd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 060dc7031139ae57d334b0d1824f96620361244b53ce62753c511225537bb6d68730b2cd235b297bea037ef59cc32571254f62444d9d60ea847002ce5208be06
|
7
|
+
data.tar.gz: 3ae2d1a41001e113f57f398000892c67518910485a90520514ed5bbc0f7fd379f59aefc07f9aa0a7e29001145c81a20fb89d0ab9d8f6e6c453920a8a31796422
|
data/README.md
CHANGED
data/exe/fusuma
CHANGED
@@ -1,6 +1,16 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
|
+
require 'optparse'
|
3
4
|
require_relative '../lib/fusuma'
|
4
5
|
|
5
|
-
|
6
|
-
|
6
|
+
option = {}
|
7
|
+
OptionParser.new do |opt|
|
8
|
+
opt.on('-v',
|
9
|
+
'--verbose',
|
10
|
+
'shows details about the results of running fusuma') do |v|
|
11
|
+
option[:verbose] = v
|
12
|
+
end
|
13
|
+
opt.parse!(ARGV)
|
14
|
+
end
|
15
|
+
|
16
|
+
Fusuma::Runner.run(option)
|
data/lib/fusuma.rb
CHANGED
@@ -5,7 +5,6 @@ require_relative 'fusuma/multi_logger'
|
|
5
5
|
require 'logger'
|
6
6
|
require 'open3'
|
7
7
|
require 'yaml'
|
8
|
-
require 'optparse'
|
9
8
|
|
10
9
|
# for debug
|
11
10
|
# require 'pry-byebug'
|
@@ -15,29 +14,15 @@ module Fusuma
|
|
15
14
|
# main class
|
16
15
|
class Runner
|
17
16
|
class << self
|
18
|
-
def run(
|
19
|
-
read_options(
|
20
|
-
return if @stop
|
17
|
+
def run(option = {})
|
18
|
+
read_options(option)
|
21
19
|
instance = new
|
22
20
|
instance.read_libinput
|
23
21
|
end
|
24
22
|
|
25
|
-
def read_options(
|
26
|
-
debug =
|
27
|
-
help = args.fetch(:h, false)
|
23
|
+
def read_options(option)
|
24
|
+
debug = option.fetch(:verbose, false)
|
28
25
|
MultiLogger.instance.debug_mode = true if debug
|
29
|
-
@stop = if help
|
30
|
-
print_help
|
31
|
-
true
|
32
|
-
else
|
33
|
-
false
|
34
|
-
end
|
35
|
-
end
|
36
|
-
|
37
|
-
def print_help
|
38
|
-
puts 'Options:
|
39
|
-
-h, print this help.
|
40
|
-
-v, print to STDOUT with debug mode.'
|
41
26
|
end
|
42
27
|
end
|
43
28
|
|
@@ -97,12 +82,12 @@ module Fusuma
|
|
97
82
|
|
98
83
|
def swipe(finger, direction)
|
99
84
|
shortcut = event_map['swipe'][finger.to_i][direction]['shortcut']
|
100
|
-
`xdotool key #{shortcut}`
|
85
|
+
`xdotool key #{shortcut}` unless shortcut.nil?
|
101
86
|
end
|
102
87
|
|
103
88
|
def pinch(zoom)
|
104
89
|
shortcut = event_map['pinch'][zoom]['shortcut']
|
105
|
-
`xdotool key #{shortcut}`
|
90
|
+
`xdotool key #{shortcut}` unless shortcut.nil?
|
106
91
|
end
|
107
92
|
|
108
93
|
def event_map
|
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.1.
|
4
|
+
version: 0.1.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- iberianpig
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-12-
|
11
|
+
date: 2016-12-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|