x4ss 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (6) hide show
  1. checksums.yaml +7 -0
  2. checksums.yaml.gz.sig +0 -0
  3. data.tar.gz.sig +0 -0
  4. data/lib/x4ss.rb +38 -0
  5. metadata +67 -0
  6. metadata.gz.sig +0 -0
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 7c10ec6be0c650842cf279d4b9c5d81599e2a0f2
4
+ data.tar.gz: 11058b8dacfd8d59a5c43cc573d5a6ebae77845d
5
+ SHA512:
6
+ metadata.gz: ca6e5d4f74e3e8127526710dcc1c579ed2e44f7bc48afba9fca09bbf7fe0de3a4b893f227cc761cd161d0a3d579e8601e7d66207ee040d7eb440e374f03bf1a4
7
+ data.tar.gz: e7b2e667f7dfd891bc078bcdae5962fca04a3e6eb28ec407d58b51e42436d6a45e4db61d20f48c66d7e1eb1563956bf6c6d8314757a3518a7a89ba1fd2891593
Binary file
Binary file
@@ -0,0 +1,38 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ # file: x4ss.rb
4
+
5
+ # A wrapper for xfce4-screenshooter and xclip to save screenshots
6
+
7
+ class X4ss
8
+
9
+ def initialize(savefile=nil, mouse: false)
10
+
11
+ @file = savefile
12
+ @count = 1
13
+ @mouse = mouse ? 't' : ''
14
+
15
+ end
16
+
17
+ # mode options: :window, :fullscreen
18
+ #
19
+ def capture(mode=:fullscreen)
20
+
21
+ area = mode == :fullscreen ? 'f' : 'w'
22
+ `xfce4-screenshooter -c#{area}#{@mouse}`
23
+ @blob = `xclip -selection clipboard -target image/png -out`
24
+ File.write @file % @count, @blob
25
+ @count += 1
26
+ end
27
+
28
+ def from_blob
29
+ @blob
30
+ end
31
+
32
+ end
33
+
34
+
35
+ x4ss = X4ss.new '/tmp/fun.png'
36
+ x4ss.capture
37
+ x4ss = X4ss.new '/tmp/fun%d.png'
38
+ x4ss.capture
metadata ADDED
@@ -0,0 +1,67 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: x4ss
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - James Robertson
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain:
11
+ - |
12
+ -----BEGIN CERTIFICATE-----
13
+ MIIDljCCAn6gAwIBAgIBATANBgkqhkiG9w0BAQUFADBIMRIwEAYDVQQDDAlnZW1t
14
+ YXN0ZXIxHjAcBgoJkiaJk/IsZAEZFg5qYW1lc3JvYmVydHNvbjESMBAGCgmSJomT
15
+ 8ixkARkWAmV1MB4XDTE5MDUxNzA4MDIzMVoXDTIwMDUxNjA4MDIzMVowSDESMBAG
16
+ A1UEAwwJZ2VtbWFzdGVyMR4wHAYKCZImiZPyLGQBGRYOamFtZXNyb2JlcnRzb24x
17
+ EjAQBgoJkiaJk/IsZAEZFgJldTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC
18
+ ggEBAKeI55/bKvJmHZ9iqiCvc1ZiFJokfFR29JdE3Ux8ZEzvwneZMtCkMHHDK1Oa
19
+ actcm/evQ/if8r84u3IyZhok0FVFgp2qKEQymPv38CXk5F2S+ZP4re1oulgEnZSZ
20
+ 3XkBeYVqhcdbgAkPw8XN74cJ+9qtnxB6G6yJOSnf2e1Proi8B6XQDwVGc0nwL7VN
21
+ 8teBEobpNpdcE0m0pq0eN+zAnXVol8ZYcnPi4AnIQj54IyIda+AL/ZwuEa3ztm+N
22
+ pSGR0tsXwEQ0cArZX7TVASEEpD3cucnmhL7gUBBcbak+QN+P4PIbcJDRl/QQ4QhV
23
+ caIEzg1oM39ATRNCKBCa+ydSWykCAwEAAaOBijCBhzAJBgNVHRMEAjAAMAsGA1Ud
24
+ DwQEAwIEsDAdBgNVHQ4EFgQU6pT0VZEHFL6VlDUBRARCmVaroF4wJgYDVR0RBB8w
25
+ HYEbZ2VtbWFzdGVyQGphbWVzcm9iZXJ0c29uLmV1MCYGA1UdEgQfMB2BG2dlbW1h
26
+ c3RlckBqYW1lc3JvYmVydHNvbi5ldTANBgkqhkiG9w0BAQUFAAOCAQEAlxvGn3Gm
27
+ WVMI+m65Q4Tq2qViMX7sjEjN/wKx27vxrRoPSf8qML92H1k8biHTKyOG6AQllLYc
28
+ TDXh0onVE9gIvSlDm2VK3BuSYj+8fZOmPe+KOMw6Pq6Hi5xq3nR1/5WCD9FFGwYF
29
+ CBRWceasVix9eSHqA8ydagH7mDOqrnFRbpy2S4SBXY7vrKZCkoqhys0CGK0mWEyn
30
+ q2Qt4PHD2U0FXgRnWkcUQChsqZn4bUY23qFNOzy7GyncraJ1qyLwlSmjthz32kJj
31
+ T8EEvno4Yr6u3HjCydaJJ72Dq1RKcpnTDYiYzFRF9KFXdVkhaXBH1d8nOCcpgxlc
32
+ uUB84fdao69LcA==
33
+ -----END CERTIFICATE-----
34
+ date: 2019-05-17 00:00:00.000000000 Z
35
+ dependencies: []
36
+ description:
37
+ email: james@jamesrobertson.eu
38
+ executables: []
39
+ extensions: []
40
+ extra_rdoc_files: []
41
+ files:
42
+ - lib/x4ss.rb
43
+ homepage: https://github.com/jrobertson/x4ss
44
+ licenses:
45
+ - MIT
46
+ metadata: {}
47
+ post_install_message:
48
+ rdoc_options: []
49
+ require_paths:
50
+ - lib
51
+ required_ruby_version: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - ">="
54
+ - !ruby/object:Gem::Version
55
+ version: '0'
56
+ required_rubygems_version: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - ">="
59
+ - !ruby/object:Gem::Version
60
+ version: '0'
61
+ requirements: []
62
+ rubyforge_project:
63
+ rubygems_version: 2.5.2.1
64
+ signing_key:
65
+ specification_version: 4
66
+ summary: A wrapper for xfce4-screenshooter and xclip to save screenshots.
67
+ test_files: []
Binary file