bingwallpaper 0.6.8 → 0.6.9
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/.ruby-version +1 -1
- data/README.md +9 -10
- data/bin/bingwallpaper +24 -33
- data/bingwallpaper.gemspec +1 -1
- data/lib/bingwallpaper/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 8aed9f2468e21665442e0d8537d91d82b624316d1601359e33511e8d44078b0f
|
|
4
|
+
data.tar.gz: 23d14d63c53613d4f875fe4217496411b7871fbe47b81fc7e935b7a402796510
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2d3d51897354e23b896bd44cec8bc0e573edd5beddc388628df2d77c679d49c4c55fba6cd156a0493ba529841b20db9ac38f38b91f650e9bc7bdffa59b30d093
|
|
7
|
+
data.tar.gz: c3aea2b12293dcf6a1ee856ca3c7881a7f3f5b9478625b35585c8802351f59ae87233187d01cc9124dc1cedb9a244828195054c94f489c0442e88f6a969bd79c
|
data/.ruby-version
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
3.4.
|
|
1
|
+
3.4.8
|
data/README.md
CHANGED
|
@@ -14,12 +14,9 @@ If you find this code useful in any way, please feel free to...
|
|
|
14
14
|
|
|
15
15
|
## How It Works
|
|
16
16
|
|
|
17
|
-
I wrote this script with my own environment in mind, so it's pretty
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
Lastly, it uses [Feh][1], [swaymsg][3] or Gnome to set the wallpaper for your
|
|
21
|
-
environment. I've tested it in [i3][2], [Sway][4] and Gnome 3.14.2 and nowhere
|
|
22
|
-
else.
|
|
17
|
+
I wrote this script with my own environment in mind, so it's pretty simple-minded. It fetches the XML describing today's image, then fetches the 1920x1200 sized version if it's available, the lower resolution version if not. Lastly, it uses [Feh][1], [swaymsg][3], [hyprpaper][5] or Gnome to set the wallpaper for your environment. I've tested it in [i3][2], [Sway][4] and Gnome 3.14.2 and nowhere else.
|
|
18
|
+
|
|
19
|
+
You can also have it download the file and return the path on standard out so that you can work it into a script of your own. 😉
|
|
23
20
|
|
|
24
21
|
## Using the Script
|
|
25
22
|
|
|
@@ -36,11 +33,12 @@ Here's the usage information...
|
|
|
36
33
|
|
|
37
34
|
```
|
|
38
35
|
Usage: bingwallpaper [options]
|
|
36
|
+
-d, --down Download only, return path to image
|
|
39
37
|
-g, --gnome Set Gnome background
|
|
40
|
-
|
|
41
|
-
-f, --
|
|
42
|
-
-s, --sway Use swaymsg to set the background, overwrite
|
|
43
|
-
|
|
38
|
+
--lock Set Gnome lock screen background
|
|
39
|
+
-f, --feh Use feh to set the background (the default)
|
|
40
|
+
-s, --sway Use swaymsg to set the background, overwrite ~/.config/sway/config.d/wallpaper
|
|
41
|
+
-l, --hypr Use Hyprpaper to set the background
|
|
44
42
|
-h, --help Prints this help
|
|
45
43
|
```
|
|
46
44
|
|
|
@@ -50,3 +48,4 @@ Usage: bingwallpaper [options]
|
|
|
50
48
|
[2]: http://i3wm.org/
|
|
51
49
|
[3]: https://github.com/swaywm/sway/blob/master/swaymsg/swaymsg.1.scd
|
|
52
50
|
[4]: https://swaywm.org/
|
|
51
|
+
[5]: https://wiki.hypr.land/Hypr-Ecosystem/hyprpaper/
|
data/bin/bingwallpaper
CHANGED
|
@@ -42,10 +42,15 @@ OptionParser.new do |opts|
|
|
|
42
42
|
options[:sway] = s
|
|
43
43
|
end
|
|
44
44
|
|
|
45
|
-
opts.on("-l", "--hypr", "Use Hyprpaper to set the
|
|
45
|
+
opts.on("-l", "--hypr", "Use Hyprpaper to set the background") do |l|
|
|
46
46
|
options[:hypr] = l
|
|
47
47
|
end
|
|
48
48
|
|
|
49
|
+
opts.on("-x", "--script PATH_TO_SCRIPT",
|
|
50
|
+
"Invoke the provided script with the path to the image of the day") do |script|
|
|
51
|
+
options[:script] = script
|
|
52
|
+
end
|
|
53
|
+
|
|
49
54
|
opts.on("-h", "--help", "Prints this help") do
|
|
50
55
|
puts opts
|
|
51
56
|
exit
|
|
@@ -124,58 +129,44 @@ begin
|
|
|
124
129
|
end
|
|
125
130
|
end
|
|
126
131
|
|
|
127
|
-
|
|
132
|
+
image_path_out = nil
|
|
128
133
|
if image_path.exist?
|
|
134
|
+
image_path_out = image_path
|
|
135
|
+
elsif fallback_image_path.exist?
|
|
136
|
+
image_path_out = fallback_image_path
|
|
137
|
+
logger.info "Using the fallback, lower resolution image of the day"
|
|
138
|
+
end
|
|
129
139
|
|
|
130
|
-
if options[:down]
|
|
131
|
-
logger.info "Returning background image path only"
|
|
132
|
-
puts(image_path)
|
|
133
|
-
elsif options[:gnome]
|
|
134
|
-
logger.info "Setting background with Gnome"
|
|
135
|
-
`gsettings set org.gnome.desktop.background picture-uri "file:///#{image_path}"`
|
|
136
|
-
elsif options[:sway]
|
|
137
|
-
logger.info "Setting background with swaymsg"
|
|
138
|
-
`swaymsg output "*" background #{image_path} fill`
|
|
139
|
-
`echo 'exec swaymsg output "*" background #{image_path} fill' > ~/.config/sway/config.d/wallpaper`
|
|
140
|
-
elsif options[:hypr]
|
|
141
|
-
logger.info "Setting background with Hyprpaper"
|
|
142
|
-
`hyprctl hyprpaper reload ,#{image_path}`
|
|
143
|
-
elsif options[:feh]
|
|
144
|
-
logger.info "Setting background with feh"
|
|
145
|
-
`feh --bg-fill #{image_path}`
|
|
146
|
-
else
|
|
147
|
-
logger.info "Unknown option, no background is being set"
|
|
148
|
-
end
|
|
149
140
|
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
`gsettings set org.gnome.desktop.screensaver picture-uri "file:///#{image_path}"`
|
|
153
|
-
end
|
|
154
|
-
elsif fallback_image_path.exist?
|
|
141
|
+
# set the wallpaper
|
|
142
|
+
if !image_path_out.nil?
|
|
155
143
|
|
|
156
144
|
if options[:down]
|
|
157
145
|
logger.info "Returning background image path only"
|
|
158
|
-
puts(
|
|
146
|
+
puts(image_path_out)
|
|
159
147
|
elsif options[:gnome]
|
|
160
148
|
logger.info "Setting background with Gnome"
|
|
161
|
-
`gsettings set org.gnome.desktop.background picture-uri "file:///#{
|
|
149
|
+
`gsettings set org.gnome.desktop.background picture-uri "file:///#{image_path_out}"`
|
|
162
150
|
elsif options[:sway]
|
|
163
151
|
logger.info "Setting background with swaymsg"
|
|
164
|
-
`swaymsg output "*" background #{
|
|
165
|
-
`echo 'exec swaymsg output "*" background #{
|
|
152
|
+
`swaymsg output "*" background #{image_path_out} fill`
|
|
153
|
+
`echo 'exec swaymsg output "*" background #{image_path_out} fill' > ~/.config/sway/config.d/wallpaper`
|
|
166
154
|
elsif options[:hypr]
|
|
167
155
|
logger.info "Setting background with Hyprpaper"
|
|
168
|
-
`hyprctl hyprpaper reload ,#{
|
|
156
|
+
`hyprctl hyprpaper reload ,#{image_path_out}`
|
|
169
157
|
elsif options[:feh]
|
|
170
158
|
logger.info "Setting background with feh"
|
|
171
|
-
`feh --bg-fill #{
|
|
159
|
+
`feh --bg-fill #{image_path_out}`
|
|
160
|
+
elsif options[:script]
|
|
161
|
+
logger.info "Invoking custom script #{options[:script]} with #{image_path_out}"
|
|
162
|
+
`#{options[:script]} #{image_path_out}`
|
|
172
163
|
else
|
|
173
164
|
logger.info "Unknown option, no background is being set"
|
|
174
165
|
end
|
|
175
166
|
|
|
176
167
|
if options[:lock]
|
|
177
168
|
logger.info "Setting lock background with Gnome"
|
|
178
|
-
`gsettings set org.gnome.desktop.screensaver picture-uri "file:///#{
|
|
169
|
+
`gsettings set org.gnome.desktop.screensaver picture-uri "file:///#{image_path_out}"`
|
|
179
170
|
end
|
|
180
171
|
else
|
|
181
172
|
|
data/bingwallpaper.gemspec
CHANGED
|
@@ -18,7 +18,7 @@ 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.required_ruby_version = '~> 3.
|
|
21
|
+
spec.required_ruby_version = '~> 3.4.1'
|
|
22
22
|
spec.add_dependency 'logger', '~> 1.6'
|
|
23
23
|
spec.add_dependency 'nokogiri', '~> 1.18'
|
|
24
24
|
spec.add_dependency 'OptionParser', '~> 0.5.1'
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: bingwallpaper
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.6.
|
|
4
|
+
version: 0.6.9
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- cmiles74
|
|
@@ -180,14 +180,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
180
180
|
requirements:
|
|
181
181
|
- - "~>"
|
|
182
182
|
- !ruby/object:Gem::Version
|
|
183
|
-
version:
|
|
183
|
+
version: 3.4.1
|
|
184
184
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
185
185
|
requirements:
|
|
186
186
|
- - ">="
|
|
187
187
|
- !ruby/object:Gem::Version
|
|
188
188
|
version: '0'
|
|
189
189
|
requirements: []
|
|
190
|
-
rubygems_version:
|
|
190
|
+
rubygems_version: 4.0.0
|
|
191
191
|
specification_version: 4
|
|
192
192
|
summary: Sets your wallpaper to Bing's "Image of the Day"
|
|
193
193
|
test_files: []
|