nautilus_scripts 0.0.2 → 0.0.3
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/lib/nautilus_scripts.rb +15 -8
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1b6aee57620c0e7a515e7c1e03aa5ba0bce527bf
|
4
|
+
data.tar.gz: db098d058f7a7cedc58a341f77f9cc535e57fea7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8bd9113e7dc6334d13312cb09e0d5d39a11d3cc97365217bd5cbbe6c0f15d16a7eaa4721716501f5b965182d759072984f0e705ec9104ec6fddb76a89a8bbfd8
|
7
|
+
data.tar.gz: bda781cc758fc493e21936299b20c2f0648c1fa2ada10c375b0bfe4f6cf8e9c07883a0b4c082b0510cbc8c5efa2c5cefed57889a1b76a57a9fb7f1c069715231
|
data/lib/nautilus_scripts.rb
CHANGED
@@ -1,5 +1,8 @@
|
|
1
1
|
|
2
2
|
module Nautilus
|
3
|
+
GEOMETRY_RE=/(?<w>\d+)x(?<h>\d+)\+(?<x>\d+)\+(?<y>\d+)/
|
4
|
+
GEOMETRY_KEYS=[:x, :y, :w, :h]
|
5
|
+
|
3
6
|
class Scripts
|
4
7
|
include Enumerable
|
5
8
|
|
@@ -10,33 +13,37 @@ module Nautilus
|
|
10
13
|
}
|
11
14
|
end
|
12
15
|
|
16
|
+
# Convert file URI to filesystem path
|
13
17
|
def defile(item)
|
14
18
|
item.sub(/^file:\/\//, "").gsub(/%20/, " ")
|
15
19
|
end
|
16
20
|
|
17
|
-
#
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
+
# Convert filesystem path to file URI
|
22
|
+
def refile(item)
|
23
|
+
item.sub(/^/, "file://").gsub(/\s/, "%20")
|
24
|
+
end
|
25
|
+
|
26
|
+
#NAUTILUS_SCRIPT_CURRENT_URI=file:///home/tmp/bjs/nexus_5/links/20161202/Internal%20shared%20storage/DCIM/Camera
|
21
27
|
def self.current_uri(default="")
|
22
28
|
ENV['NAUTILUS_SCRIPT_CURRENT_URI']||default
|
23
29
|
end
|
24
30
|
|
31
|
+
#NAUTILUS_SCRIPT_SELECTED_FILE_PATHS='/home/tmp/bjs/nexus_5/links/20161202/Internal shared storage/DCIM/Camera/IMG_20131122_111539.jpg
|
25
32
|
def self.selected_file_paths(default="")
|
26
33
|
(ENV['NAUTILUS_SCRIPT_SELECTED_FILE_PATHS']||default).split(/\n/)
|
27
34
|
end
|
28
35
|
|
36
|
+
#NAUTILUS_SCRIPT_SELECTED_URIS='file:///home/tmp/bjs/nexus_5/links/20161202/Internal%20shared%20storage/DCIM/Camera/IMG_20131122_111539.jpg
|
29
37
|
def self.selected_uris(default="")
|
30
38
|
(ENV['NAUTILUS_SCRIPT_SELECTED_URIS']||default).split(/\n/)
|
31
39
|
end
|
32
40
|
|
41
|
+
#NAUTILUS_SCRIPT_WINDOW_GEOMETRY=1540x808+26+23
|
33
42
|
def self.window_geometry(default="")
|
34
43
|
geo=ENV['NAUTILUS_SCRIPT_WINDOW_GEOMETRY']||default
|
35
|
-
m=geo.match(
|
44
|
+
m=geo.match(GEOMETRY_RE)
|
36
45
|
h={}
|
37
|
-
[:x, :y, :w, :h].
|
38
|
-
h[k]=m.nil? ? nil : m[k]
|
39
|
-
}
|
46
|
+
[:x, :y, :w, :h].map { |k| h[k]=m.nil? ? nil : m[k] }
|
40
47
|
return h
|
41
48
|
end
|
42
49
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nautilus_scripts
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Steeve McCauley
|
@@ -10,7 +10,8 @@ bindir: bin
|
|
10
10
|
cert_chain: []
|
11
11
|
date: 2016-12-03 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
|
-
description:
|
13
|
+
description: class for nautilus scripts to manipulate files selected in the filemanager
|
14
|
+
in the scripts directory (~/.local/share/nautilus/scripts)
|
14
15
|
email: steeve@oneguycoding.com
|
15
16
|
executables: []
|
16
17
|
extensions: []
|