bingwallpaper 0.6.1 → 0.6.5

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: cbe0ff2f5121c0ed61a1409c03032217f3dcd9c1
4
- data.tar.gz: 7e93502c56083636d162b1bbdf99150991edb065
2
+ SHA256:
3
+ metadata.gz: e9b6e4e16f79f4d01c5959b5823b0861ebd7b0fcd18da4c3830436f694380392
4
+ data.tar.gz: 3d3b4902fb0d9e39aaca32aa1004f8d36fe4246d83374502824572933695fc82
5
5
  SHA512:
6
- metadata.gz: c159dee737b17aa458bcb3106a95e5e8fb0c224ef62729abb59fb8a1a77e557901e40e748336b1e1c108278e74d66378633ba96f47c37631518a95c5150a4421
7
- data.tar.gz: 84be0238face2db9f554d6c3f3dcd579b7b7f257e767859c8578b149d2ad1ec297deff4a41bcdfed6287b1c804fe315c6e3fe8abf8141614d92f844102057643
6
+ metadata.gz: b2e2e75f7ae3d92a7116965af58827a9155f070446975506032b6080f3aa652e8f66eedccb50b577cce201383973e44d0b469739f30b6883f2df96b53f379520
7
+ data.tar.gz: dad208d2b6bc53c5645a7db08df145be5d0a166753c3db96de89a9b4806e56ad016e6f0297074bc4d15a3222aa70f070ceabe70b57aa6600469477d9b9f88731
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.5.3
1
+ 3.0.2
data/Gemfile CHANGED
@@ -1,4 +1,6 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
+ gem 'irb', require: false
4
+
3
5
  # Specify your gem's dependencies in bingwallpaper.gemspec
4
6
  gemspec
data/README.md CHANGED
@@ -7,6 +7,11 @@ This project provides a simple Ruby script that will download the
7
7
  "Image of the Day" from [Bing][0] and then sets it as your current
8
8
  wallpaper.
9
9
 
10
+ If you find this code useful in any way, please feel free to...
11
+
12
+ <a href="https://www.buymeacoffee.com/cmiles74" target="_blank"><img src="https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png" alt="Buy Me A Coffee" style="height: 41px !important;width: 174px !important;box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;-webkit-box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;" ></a>
13
+
14
+
10
15
  ## How It Works
11
16
 
12
17
  I wrote this script with my own environment in mind, so it's pretty
data/bin/bingwallpaper CHANGED
@@ -34,6 +34,10 @@ OptionParser.new do |opts|
34
34
  options[:feh] = f
35
35
  end
36
36
 
37
+ opts.on("-s", "--sway", "Use swaymsg to set the background, overwrite ~/.config/sway/config.d/wallpaper") do |s|
38
+ options[:sway] = s
39
+ end
40
+
37
41
  opts.on("-h", "--help", "Prints this help") do
38
42
  puts opts
39
43
  exit
@@ -121,6 +125,10 @@ begin
121
125
  if options[:gnome]
122
126
  logger.info "Setting background with Gnome"
123
127
  `gsettings set org.gnome.desktop.background picture-uri "file:///#{image_path}"`
128
+ elsif options[:sway]
129
+ logger.info "Setting background with swaymsg"
130
+ `swaymsg output "*" background #{image_path} fill`
131
+ `echo 'exec swaymsg output "*" background #{image_path} fill' > ~/.config/sway/config.d/wallpaper`
124
132
  else
125
133
  logger.info "Setting background with feh"
126
134
  `feh --bg-fill #{image_path}`
@@ -139,6 +147,10 @@ begin
139
147
  if options[:gnome]
140
148
  logger.info "Setting background with Gnome"
141
149
  `gsettings set org.gnome.desktop.background picture-uri "file:///#{fallback_image_path}"`
150
+ elsif options[:sway]
151
+ logger.info "Setting background with swaymsg"
152
+ `swaymsg output "*" background #{fallback_image_path} fill`
153
+ `echo 'exec swaymsg output "*" background #{fallback_image_path} fill' > ~/.config/sway/config.d/wallpaper`
142
154
  else
143
155
  logger.info "Setting background with feh"
144
156
  `feh --bg-fill #{fallback_image_path}`
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
10
10
  spec.email = ["twitch@nervestaple.com"]
11
11
  spec.summary = %q{Sets your wallpaper to Bing's "Image of the Day"}
12
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
- spec.homepage = ""
13
+ spec.homepage = "https://github.com/cmiles74/bingwallpaper"
14
14
  spec.license = "MIT"
15
15
 
16
16
  spec.files = `git ls-files -z`.split("\x0")
@@ -18,11 +18,14 @@ Gem::Specification.new do |spec|
18
18
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
19
  spec.require_paths = ["lib"]
20
20
 
21
- spec.add_dependency "nokogiri", "~> 1.8.2"
21
+ spec.required_ruby_version = '~> 3.0'
22
+ spec.add_dependency "nokogiri", "~> 1.12.4"
22
23
  spec.add_dependency "OptionParser", "~> 0.5.1"
23
- spec.add_development_dependency "bundler", "~> 1.6"
24
- spec.add_development_dependency "rake"
25
- spec.add_development_dependency "pry", "~> 0.10.3"
26
- spec.add_development_dependency "pry-doc", ">= 0.8.0"
27
- spec.add_development_dependency "method_source", ">= 0.8.2"
24
+ spec.add_development_dependency "bundler", "~> 2.2.27"
25
+ spec.add_development_dependency "irb", "~> 1.3.7"
26
+ spec.add_development_dependency "rake", "~> 13.0.6"
27
+ spec.add_development_dependency "pry", "~> 0.10"
28
+ spec.add_development_dependency "pry-doc", "~> 0.6.0"
29
+ spec.add_development_dependency "method_source", "~> 1.0"
30
+ spec.add_development_dependency "webrick", "~> 1.5.0"
28
31
  end
@@ -76,7 +76,7 @@ module Bingwallpaper
76
76
  # url:: complete path to the Bing image of the day
77
77
  def parse_xml(url)
78
78
 
79
- doc = Nokogiri::HTML(open(url))
79
+ doc = Nokogiri::HTML(URI.open(url))
80
80
 
81
81
  doc.xpath('//images/image').map do |image|
82
82
 
@@ -129,7 +129,7 @@ module Bingwallpaper
129
129
 
130
130
  # download the hi-res image
131
131
  open(file_path, 'wb') do |file|
132
- file << open(url).read
132
+ file << URI.open(url).read
133
133
  end
134
134
  rescue Exception => exception
135
135
  file_path.delete
@@ -1,3 +1,3 @@
1
1
  module Bingwallpaper
2
- VERSION ||= "0.6.1"
2
+ VERSION ||= "0.6.5"
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.6.1
4
+ version: 0.6.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - cmiles74
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-03-12 00:00:00.000000000 Z
11
+ date: 2021-09-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 1.8.2
19
+ version: 1.12.4
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 1.8.2
26
+ version: 1.12.4
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: OptionParser
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -44,70 +44,98 @@ dependencies:
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '1.6'
47
+ version: 2.2.27
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '1.6'
54
+ version: 2.2.27
55
+ - !ruby/object:Gem::Dependency
56
+ name: irb
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: 1.3.7
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: 1.3.7
55
69
  - !ruby/object:Gem::Dependency
56
70
  name: rake
57
71
  requirement: !ruby/object:Gem::Requirement
58
72
  requirements:
59
- - - ">="
73
+ - - "~>"
60
74
  - !ruby/object:Gem::Version
61
- version: '0'
75
+ version: 13.0.6
62
76
  type: :development
63
77
  prerelease: false
64
78
  version_requirements: !ruby/object:Gem::Requirement
65
79
  requirements:
66
- - - ">="
80
+ - - "~>"
67
81
  - !ruby/object:Gem::Version
68
- version: '0'
82
+ version: 13.0.6
69
83
  - !ruby/object:Gem::Dependency
70
84
  name: pry
71
85
  requirement: !ruby/object:Gem::Requirement
72
86
  requirements:
73
87
  - - "~>"
74
88
  - !ruby/object:Gem::Version
75
- version: 0.10.3
89
+ version: '0.10'
76
90
  type: :development
77
91
  prerelease: false
78
92
  version_requirements: !ruby/object:Gem::Requirement
79
93
  requirements:
80
94
  - - "~>"
81
95
  - !ruby/object:Gem::Version
82
- version: 0.10.3
96
+ version: '0.10'
83
97
  - !ruby/object:Gem::Dependency
84
98
  name: pry-doc
85
99
  requirement: !ruby/object:Gem::Requirement
86
100
  requirements:
87
- - - ">="
101
+ - - "~>"
88
102
  - !ruby/object:Gem::Version
89
- version: 0.8.0
103
+ version: 0.6.0
90
104
  type: :development
91
105
  prerelease: false
92
106
  version_requirements: !ruby/object:Gem::Requirement
93
107
  requirements:
94
- - - ">="
108
+ - - "~>"
95
109
  - !ruby/object:Gem::Version
96
- version: 0.8.0
110
+ version: 0.6.0
97
111
  - !ruby/object:Gem::Dependency
98
112
  name: method_source
99
113
  requirement: !ruby/object:Gem::Requirement
100
114
  requirements:
101
- - - ">="
115
+ - - "~>"
102
116
  - !ruby/object:Gem::Version
103
- version: 0.8.2
117
+ version: '1.0'
104
118
  type: :development
105
119
  prerelease: false
106
120
  version_requirements: !ruby/object:Gem::Requirement
107
121
  requirements:
108
- - - ">="
122
+ - - "~>"
123
+ - !ruby/object:Gem::Version
124
+ version: '1.0'
125
+ - !ruby/object:Gem::Dependency
126
+ name: webrick
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - "~>"
109
130
  - !ruby/object:Gem::Version
110
- version: 0.8.2
131
+ version: 1.5.0
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - "~>"
137
+ - !ruby/object:Gem::Version
138
+ version: 1.5.0
111
139
  description: This script downloads the "Image of the Day" and then uses Feh or Gnome
112
140
  to set your desktop wallpaper. More information available at https://github.com/cmiles74/bingwallpaper/.
113
141
  email:
@@ -128,28 +156,27 @@ files:
128
156
  - lib/bingwallpaper.rb
129
157
  - lib/bingwallpaper/image.rb
130
158
  - lib/bingwallpaper/version.rb
131
- homepage: ''
159
+ homepage: https://github.com/cmiles74/bingwallpaper
132
160
  licenses:
133
161
  - MIT
134
162
  metadata: {}
135
- post_install_message:
163
+ post_install_message:
136
164
  rdoc_options: []
137
165
  require_paths:
138
166
  - lib
139
167
  required_ruby_version: !ruby/object:Gem::Requirement
140
168
  requirements:
141
- - - ">="
169
+ - - "~>"
142
170
  - !ruby/object:Gem::Version
143
- version: '0'
171
+ version: '3.0'
144
172
  required_rubygems_version: !ruby/object:Gem::Requirement
145
173
  requirements:
146
174
  - - ">="
147
175
  - !ruby/object:Gem::Version
148
176
  version: '0'
149
177
  requirements: []
150
- rubyforge_project:
151
- rubygems_version: 2.4.8
152
- signing_key:
178
+ rubygems_version: 3.2.3
179
+ signing_key:
153
180
  specification_version: 4
154
181
  summary: Sets your wallpaper to Bing's "Image of the Day"
155
182
  test_files: []