fusuma 0.7.0 → 0.7.1
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/exe/fusuma +4 -8
- data/lib/fusuma.rb +27 -11
- data/lib/fusuma/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e5e7633611c459a64db5cba4070e79049a6cf054
|
4
|
+
data.tar.gz: f5c6cdfaf53b3ccd80940dcbfef20111e7511c18
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 207655e6474d8abcea5c75d8e2a7993d4410af1620c15bdfc90530930adafe04134f96cce9870603e3c798535addae9d7c8b132b0748a50aaf0509c9788b8997
|
7
|
+
data.tar.gz: 691af29a6416febc5fca48835f5ea2606c306eb1f6f50ac5188d7abd9a9669805c9ee2de12f30ab437a582dbb9bce6461442a7b1a393b5000fe6d041b818028c
|
data/exe/fusuma
CHANGED
@@ -7,8 +7,8 @@ option = {}
|
|
7
7
|
OptionParser.new do |opt|
|
8
8
|
opt.on('-c',
|
9
9
|
'--config=path/to/file',
|
10
|
-
'Use an alternative config file') do |
|
11
|
-
option[:
|
10
|
+
'Use an alternative config file') do |config_path|
|
11
|
+
option[:config_path] = config_path
|
12
12
|
end
|
13
13
|
|
14
14
|
opt.on('-d',
|
@@ -24,12 +24,8 @@ OptionParser.new do |opt|
|
|
24
24
|
end
|
25
25
|
|
26
26
|
opt.on('--version',
|
27
|
-
'Show fusuma version') do |
|
28
|
-
|
29
|
-
puts "OS: #{`uname -rsv`}"
|
30
|
-
puts "Distribution: #{`cat /etc/issue`}"
|
31
|
-
puts "Desktop session: #{`echo $DESKTOP_SESSION`}"
|
32
|
-
exit 0
|
27
|
+
'Show fusuma version') do |version|
|
28
|
+
option[:version] = version
|
33
29
|
end
|
34
30
|
|
35
31
|
opt.parse!(ARGV)
|
data/lib/fusuma.rb
CHANGED
@@ -17,23 +17,39 @@ module Fusuma
|
|
17
17
|
class Runner
|
18
18
|
class << self
|
19
19
|
def run(option = {})
|
20
|
-
|
21
|
-
Signal.trap('TERM') { exit } # Trap `Kill `
|
22
|
-
|
20
|
+
set_trap
|
23
21
|
read_options(option)
|
24
22
|
instance = new
|
25
23
|
instance.read_libinput
|
26
24
|
end
|
27
25
|
|
26
|
+
private
|
27
|
+
|
28
|
+
def set_trap
|
29
|
+
Signal.trap('INT') { puts exit } # Trap ^C
|
30
|
+
Signal.trap('TERM') { puts exit } # Trap `Kill `
|
31
|
+
end
|
32
|
+
|
33
|
+
def print_version
|
34
|
+
puts "---------------------------------------------"
|
35
|
+
puts "Fusuma: #{Fusuma::VERSION}"
|
36
|
+
puts "OS: #{`uname -rsv`}"
|
37
|
+
puts "Distribution: #{`cat /etc/issue`}"
|
38
|
+
puts "Desktop session: #{`echo $DESKTOP_SESSION`}"
|
39
|
+
puts "---------------------------------------------"
|
40
|
+
end
|
41
|
+
|
42
|
+
def reload_custom_config(config_path)
|
43
|
+
MultiLogger.info "use custom path: #{config_path}"
|
44
|
+
Config.instance.custom_path = config_path
|
45
|
+
Config.reload
|
46
|
+
end
|
47
|
+
|
28
48
|
def read_options(option)
|
29
|
-
option
|
30
|
-
config_path
|
31
|
-
if
|
32
|
-
|
33
|
-
Config.reload
|
34
|
-
end
|
35
|
-
MultiLogger.instance.debug_mode = true if option.fetch(:verbose, nil)
|
36
|
-
Process.daemon if option.fetch(:daemon, nil)
|
49
|
+
print_version if option[:version] || option[:verbose]
|
50
|
+
reload_custom_config(option[:config_path]) if option[:config_path]
|
51
|
+
MultiLogger.instance.debug_mode = true if option[:verbose]
|
52
|
+
Process.daemon if option[:daemon]
|
37
53
|
end
|
38
54
|
end
|
39
55
|
|
data/lib/fusuma/version.rb
CHANGED