bingwallpaper 0.5.6 → 0.5.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YmI3M2ZmNDY2ZmUwMWE1NGI1MjA4MzE4MGYyMjQzYWFhZjczMzNhOA==
4
+ YjhmMDBjNTkwNmFiNWVmNTJlN2FiMDQ4NTE2ZDlhZTViMDA5MjZhMQ==
5
5
  data.tar.gz: !binary |-
6
- NjIyZTBlODIyODcyMzY2OTgyMWRkMjM2YjQ0MjQwZmEzYjEyOGI5MQ==
6
+ MDFiMTNjZTZlOGI5NmM4MzgzNTMxZGJmOTBkMzU0ZTY5MWU5MGI0OQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- Yjk4OGZjNTBkZmFlMDU5YmJmMWIzMGM5OWY0MThhM2YwOWU3ZGFiYmQwMGJj
10
- YWI1NDAzZmM5MjNiNTE1ZDE1ZjhlYmNlODU2OGY0ZTVlYWU0ZTdmN2RmYzc4
11
- NjRiYmVkMzhmOGI0YmI5MjliZmI2ZDE1NWI5ZjA5YTNjYTlmNmM=
9
+ YzMyMDc3MTdmNmYwNGY5MWQxNWJkNDc5YzUzNThjMzNmNGY1ZGI5Mzg1OTc2
10
+ YzlkZTAzNjU4NjVlOWVjYzU4MTg1YzZhOTE0ODIzZWE0NGRhMjBlMDg3YTE1
11
+ ZWZiZmE0ODgzM2I1OGVkZjhmODgxMTZmMDZjNDYxMmRjOTAxYTE=
12
12
  data.tar.gz: !binary |-
13
- ODBhMDAxZjZiMTRmNDRhOTMwNTgzNTU4NjgzMjM5MTk4NThjYzRhYzEyMmE4
14
- ZjdmNDMzZDFiNTliY2U1NmE3ZjM4YmFkZjM4ZDM3YTgzYTA3NTJmM2FmOTk2
15
- MDJmYzgxYTRjMzZhZjZkOWQwODUxNDlhZTY4ODU0MzkwNWFhNDg=
13
+ ZDdmMGFmNDgzYzVmOWNiYTlhNGM4YWNhMmE3NjIxYTFiMmJiMmRmZjcyZTcy
14
+ YmQ1YTU0ODY3MzRhMWZhNjM2ZmUzMWQ1Yjg2ZmUyOTc1Nzc3NTM3OGUxZTE0
15
+ NmQzNTZhNjUzMmI4MmVlODM1NDg5OGUxMjE0ZjQ0ZmU3Zjg0Yjc=
data/bin/bingwallpaper CHANGED
@@ -7,6 +7,7 @@
7
7
  #
8
8
  require "bingwallpaper"
9
9
  require "logger"
10
+ require "optparse"
10
11
 
11
12
  # setup a logger
12
13
  logger = Logger.new(STDOUT)
@@ -14,6 +15,26 @@ logger.formatter = proc do |severity, time, progname, msg|
14
15
  "%-6s %s\n" % [severity, msg]
15
16
  end
16
17
 
18
+ # parse out our command-line options
19
+ options = {}
20
+
21
+ OptionParser.new do |opts|
22
+ opts.banner = "Usage: bingwallpaper [options]"
23
+
24
+ opts.on("-g", "--gnome", "Set Gnome background") do |g|
25
+ options[:gnome] = g
26
+ end
27
+
28
+ opts.on("-f", "--feg", "Use feh to set the background (the default)") do |f|
29
+ options[:feh] = f
30
+ end
31
+
32
+ opts.on("-h", "--help", "Prints this help") do
33
+ puts opts
34
+ exit
35
+ end
36
+ end.parse!
37
+
17
38
  # create an instance and set the wallpaper
18
39
  bingImage = Bingwallpaper::Image.new
19
40
 
@@ -59,13 +80,27 @@ begin
59
80
 
60
81
  # set the wallpaper
61
82
  logger.info "Wallpaper set to #{image_path}"
62
- `feh --bg-fill #{image_path}`
83
+
84
+ if options[:gnome]
85
+ logger.info "Setting background with Gnome"
86
+ `gsettings set org.gnome.desktop.background picture-uri "file:///#{image_path}"`
87
+ else
88
+ logger.info "Setting background with feh"
89
+ `feh --bg-fill #{image_path}`
90
+ end
63
91
  elsif fallback_image_path.exist?
64
92
 
65
93
  # set the wallpaper
66
94
  logger.info "Only the low-resolution image was available today."
67
95
  logger.info "Wallpaper set to #{image_path}"
68
- `feh --bg-fill #{fallback_image_path}`
96
+
97
+ if options[:gnome]
98
+ logger.info "Setting background with Gnome"
99
+ `gsettings set org.gnome.desktop.background picture-uri "file:///#{fallback_image_path}"`
100
+ else
101
+ logger.info "Setting background with feh"
102
+ `feh --bg-fill #{fallback_image_path}`
103
+ end
69
104
  else
70
105
 
71
106
  logger.info "Sorry, I couldn't download the Bing Image of the Day. :'("
@@ -9,7 +9,7 @@ Gem::Specification.new do |spec|
9
9
  spec.authors = ["cmiles74"]
10
10
  spec.email = ["twitch@nervestaple.com"]
11
11
  spec.summary = %q{Sets your wallpaper to Bing's "Image of the Day"}
12
- spec.description = %q{This script downloads the "Image of the Day" and then uses Feh to set your desktop wallpaper. More information available at https://github.com/cmiles74/bingwallpaper/.}
12
+ spec.description = %q{This script downloads the "Image of the Day" and then uses Feh or Gnome to set your desktop wallpaper. More information available at https://github.com/cmiles74/bingwallpaper/.}
13
13
  spec.homepage = ""
14
14
  spec.license = "MIT"
15
15
 
@@ -19,6 +19,7 @@ Gem::Specification.new do |spec|
19
19
  spec.require_paths = ["lib"]
20
20
 
21
21
  spec.add_dependency "nokogiri", "~> 1.6.2.1"
22
+ spec.add_dependency "OptionParser", "~> 0.5.1"
22
23
  spec.add_development_dependency "bundler", "~> 1.6"
23
24
  spec.add_development_dependency "rake"
24
25
  end
@@ -1,3 +1,3 @@
1
1
  module Bingwallpaper
2
- VERSION = "0.5.6"
2
+ VERSION = "0.5.8"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bingwallpaper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.6
4
+ version: 0.5.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - cmiles74
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-06-26 00:00:00.000000000 Z
11
+ date: 2015-03-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
@@ -24,6 +24,20 @@ dependencies:
24
24
  - - ~>
25
25
  - !ruby/object:Gem::Version
26
26
  version: 1.6.2.1
27
+ - !ruby/object:Gem::Dependency
28
+ name: OptionParser
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ~>
32
+ - !ruby/object:Gem::Version
33
+ version: 0.5.1
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ~>
39
+ - !ruby/object:Gem::Version
40
+ version: 0.5.1
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: bundler
29
43
  requirement: !ruby/object:Gem::Requirement
@@ -52,8 +66,8 @@ dependencies:
52
66
  - - ! '>='
53
67
  - !ruby/object:Gem::Version
54
68
  version: '0'
55
- description: This script downloads the "Image of the Day" and then uses Feh to set
56
- your desktop wallpaper. More information available at https://github.com/cmiles74/bingwallpaper/.
69
+ description: This script downloads the "Image of the Day" and then uses Feh or Gnome
70
+ to set your desktop wallpaper. More information available at https://github.com/cmiles74/bingwallpaper/.
57
71
  email:
58
72
  - twitch@nervestaple.com
59
73
  executables:
@@ -96,3 +110,4 @@ signing_key:
96
110
  specification_version: 4
97
111
  summary: Sets your wallpaper to Bing's "Image of the Day"
98
112
  test_files: []
113
+ has_rdoc: