hexapic 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/hexapic +5 -9
- data/hexapic.gemspec +3 -0
- data/lib/hexapic/api.rb +0 -4
- data/lib/hexapic/collage.rb +0 -2
- data/lib/hexapic/desktop_environment.rb +8 -4
- data/lib/hexapic/downloader.rb +0 -2
- data/lib/hexapic/repository.rb +0 -1
- data/lib/hexapic/version.rb +1 -1
- data/lib/hexapic/wallpaper_setter.rb +14 -4
- data/lib/hexapic.rb +10 -0
- metadata +6 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 48d064edd097a6afda83cc568cbc7c69ddf0a69d
|
4
|
+
data.tar.gz: 29458a8ea610e7947418e056e4400827f6f75b19
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 899df792cf0bea83c933cf7a0d6c1a2cd050da269c1a7d8ae435034cad58f98c71b413d068267de39ec940852050d64801fad1ff232abf920de5d317fb53a015
|
7
|
+
data.tar.gz: 8d1e18072868b42ccc9d0a29a811e91facddc923a01277369392b04be96aca5a304d429d6363ce1c0f5a9dd4f50b0174a7f5fd3370b1804b97c25a64495c9105
|
data/bin/hexapic
CHANGED
@@ -10,10 +10,6 @@ end
|
|
10
10
|
include Hexapic
|
11
11
|
require 'choice'
|
12
12
|
|
13
|
-
def help
|
14
|
-
puts 'TODO: write help'
|
15
|
-
end
|
16
|
-
|
17
13
|
def set_wallpaper
|
18
14
|
tags = Choice.choices[:tags] || ENV['WALLPAPER_TAGS'] || 'nature'
|
19
15
|
repository = Choice.choices[:repository] || ENV['WALLPAPER_REPOSITPRY'] || :instagram
|
@@ -50,13 +46,13 @@ Choice.options do
|
|
50
46
|
end
|
51
47
|
|
52
48
|
if Choice.choices[:tags]
|
53
|
-
|
49
|
+
begin
|
54
50
|
set_wallpaper
|
55
|
-
|
56
|
-
|
57
|
-
|
51
|
+
rescue Exception => e
|
52
|
+
puts e.message
|
53
|
+
end
|
58
54
|
elsif Choice.choices[:version]
|
59
55
|
print_version
|
60
56
|
else
|
61
|
-
help
|
57
|
+
Choice.help
|
62
58
|
end
|
data/hexapic.gemspec
CHANGED
@@ -11,6 +11,9 @@ Gem::Specification.new do |spec|
|
|
11
11
|
spec.summary = 'Set desktop wallpaper from social networks'
|
12
12
|
spec.description = "Pick a 6 latest pics from flickr, instagram or twitter, make collage of its and set it as Linux's background."
|
13
13
|
spec.homepage = 'https://github.com/blan4/Hexapic'
|
14
|
+
spec.metadata = { 'issue_tracker' => 'https://github.com/blan4/Hexapic/issues' }
|
15
|
+
spec.post_install_message = 'Just call hexapic -t cat'
|
16
|
+
spec.required_ruby_version = '>= 1.9.3'
|
14
17
|
spec.license = 'MIT'
|
15
18
|
|
16
19
|
spec.files = `git ls-files -z`.split("\x0")
|
data/lib/hexapic/api.rb
CHANGED
data/lib/hexapic/collage.rb
CHANGED
@@ -1,8 +1,12 @@
|
|
1
|
-
require 'open3'
|
2
|
-
|
3
1
|
module Hexapic
|
4
2
|
class DesktopEnvironment
|
5
|
-
DE = {
|
3
|
+
DE = {
|
4
|
+
'Metacity (Marco)'=> :mate,
|
5
|
+
'Xfwm4'=> :xfce4,
|
6
|
+
'Gnome3'=> :gnome3,
|
7
|
+
'Mutter (Muffin)'=> :cinnamon,
|
8
|
+
'Gala' => :gala
|
9
|
+
}
|
6
10
|
|
7
11
|
def self.which
|
8
12
|
wm_name = nil
|
@@ -19,7 +23,7 @@ module Hexapic
|
|
19
23
|
end
|
20
24
|
end
|
21
25
|
|
22
|
-
DE[wm_name]
|
26
|
+
DE[wm_name] || wm_name.to_sym
|
23
27
|
end
|
24
28
|
end
|
25
29
|
|
data/lib/hexapic/downloader.rb
CHANGED
data/lib/hexapic/repository.rb
CHANGED
data/lib/hexapic/version.rb
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
require_relative "desktop_environment"
|
2
1
|
module Hexapic
|
3
2
|
module WallpaperSetter
|
4
3
|
class XFCE4
|
@@ -31,11 +30,22 @@ module Hexapic
|
|
31
30
|
end
|
32
31
|
end
|
33
32
|
|
34
|
-
|
33
|
+
SETTER = {
|
34
|
+
mate: Mate,
|
35
|
+
gnome3: Gnome3,
|
36
|
+
xfce4: XFCE4,
|
37
|
+
kde4: KDE4,
|
38
|
+
gala: Gnome3
|
39
|
+
}
|
35
40
|
|
36
41
|
def self.build
|
37
|
-
|
38
|
-
klass
|
42
|
+
de = DesktopEnvironment.which
|
43
|
+
klass = SETTER[de]
|
44
|
+
if klass.nil?
|
45
|
+
raise "Unsupported DE #{de}. Please ask maitainer about it."
|
46
|
+
else
|
47
|
+
klass.new
|
48
|
+
end
|
39
49
|
end
|
40
50
|
end
|
41
51
|
end
|
data/lib/hexapic.rb
CHANGED
@@ -1,6 +1,16 @@
|
|
1
1
|
$LOAD_PATH.unshift File.expand_path('.')
|
2
2
|
|
3
|
+
require 'faraday'
|
4
|
+
require 'json'
|
5
|
+
require 'uri'
|
6
|
+
require 'open3'
|
7
|
+
require 'mini_magick'
|
8
|
+
require 'tempfile'
|
9
|
+
require 'fileutils'
|
10
|
+
require 'flickr'
|
11
|
+
|
3
12
|
require 'hexapic/version'
|
13
|
+
require 'hexapic/desktop_environment.rb'
|
4
14
|
require 'hexapic/wallpaper_setter'
|
5
15
|
require 'hexapic/api'
|
6
16
|
require 'hexapic/repository'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hexapic
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ilya Siganov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-11-
|
11
|
+
date: 2014-11-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -139,8 +139,9 @@ files:
|
|
139
139
|
homepage: https://github.com/blan4/Hexapic
|
140
140
|
licenses:
|
141
141
|
- MIT
|
142
|
-
metadata:
|
143
|
-
|
142
|
+
metadata:
|
143
|
+
issue_tracker: https://github.com/blan4/Hexapic/issues
|
144
|
+
post_install_message: Just call hexapic -t cat
|
144
145
|
rdoc_options: []
|
145
146
|
require_paths:
|
146
147
|
- lib
|
@@ -148,7 +149,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
148
149
|
requirements:
|
149
150
|
- - ">="
|
150
151
|
- !ruby/object:Gem::Version
|
151
|
-
version:
|
152
|
+
version: 1.9.3
|
152
153
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
153
154
|
requirements:
|
154
155
|
- - ">="
|