Skip to content

Commit 0de887b

Browse files
authored
Merge pull request #26 from neffo/version-13
Changes in this version: - update metadata.json, fix point release support - add support for the Gnome41 #25 - replace all references to Lang.bind() (13) - update build script to remove unnecessary files (.po, .h, etc) - move all code within class (nothing in init() or in global scope other than localization) - fix tray icon switching - remove non-functional map
2 parents 37117e9 + 619e0d8 commit 0de887b

21 files changed

+624
-318
lines changed

.eslintrc.yml

+247
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,247 @@
1+
env:
2+
browser: true
3+
es6: true
4+
extends: 'eslint:recommended'
5+
globals:
6+
Atomics: readonly
7+
SharedArrayBuffer: readonly
8+
parserOptions:
9+
ecmaVersion: 2018
10+
sourceType: module
11+
rules:
12+
accessor-pairs: error
13+
array-bracket-newline: 'off'
14+
array-bracket-spacing: 'off'
15+
array-callback-return: error
16+
array-element-newline: 'off'
17+
arrow-body-style: error
18+
arrow-parens: 'off'
19+
arrow-spacing:
20+
- error
21+
- after: true
22+
before: true
23+
block-scoped-var: error
24+
block-spacing: error
25+
brace-style: 'off'
26+
callback-return: error
27+
camelcase: 'off'
28+
capitalized-comments: 'off'
29+
class-methods-use-this: error
30+
comma-dangle: error
31+
comma-spacing: 'off'
32+
comma-style:
33+
- error
34+
- last
35+
complexity: error
36+
computed-property-spacing:
37+
- error
38+
- never
39+
consistent-return: error
40+
consistent-this: error
41+
curly: 'off'
42+
default-case: error
43+
dot-location: error
44+
dot-notation: 'off'
45+
eol-last: 'off'
46+
eqeqeq: 'off'
47+
func-call-spacing: 'off'
48+
func-name-matching: error
49+
func-names: 'off'
50+
func-style: 'off'
51+
function-paren-newline: 'off'
52+
generator-star-spacing: error
53+
global-require: error
54+
guard-for-in: 'off'
55+
handle-callback-err: error
56+
id-blacklist: error
57+
id-length: 'off'
58+
id-match: error
59+
implicit-arrow-linebreak: 'off'
60+
indent: 'off'
61+
indent-legacy: 'off'
62+
init-declarations: 'off'
63+
jsx-quotes: error
64+
key-spacing: 'off'
65+
keyword-spacing: 'off'
66+
line-comment-position: 'off'
67+
linebreak-style:
68+
- error
69+
- unix
70+
lines-around-comment: 'off'
71+
lines-around-directive: error
72+
lines-between-class-members:
73+
- error
74+
- always
75+
max-classes-per-file: error
76+
max-depth: error
77+
max-len: 'off'
78+
max-lines: 'off'
79+
max-lines-per-function: 'off'
80+
max-nested-callbacks: error
81+
max-params: 'off'
82+
max-statements: 'off'
83+
max-statements-per-line: error
84+
multiline-comment-style: 'off'
85+
new-cap: error
86+
new-parens: error
87+
newline-after-var: 'off'
88+
newline-before-return: 'off'
89+
newline-per-chained-call: 'off'
90+
no-alert: error
91+
no-array-constructor: error
92+
no-async-promise-executor: error
93+
no-await-in-loop: error
94+
no-bitwise: 'off'
95+
no-buffer-constructor: error
96+
no-caller: error
97+
no-catch-shadow: error
98+
no-confusing-arrow: 'off'
99+
no-continue: error
100+
no-div-regex: error
101+
no-duplicate-imports: error
102+
no-else-return: 'off'
103+
no-empty-function: error
104+
no-eq-null: 'off'
105+
no-eval: error
106+
no-extend-native: error
107+
no-extra-bind: error
108+
no-extra-label: error
109+
no-extra-parens: 'off'
110+
no-floating-decimal: error
111+
no-implicit-coercion: error
112+
no-implicit-globals: error
113+
no-implied-eval: error
114+
no-inline-comments: 'off'
115+
no-invalid-this: 'off'
116+
no-iterator: error
117+
no-label-var: error
118+
no-labels: error
119+
no-lone-blocks: error
120+
no-lonely-if: error
121+
no-loop-func: error
122+
no-magic-numbers: 'off'
123+
no-misleading-character-class: error
124+
no-mixed-operators: error
125+
no-mixed-requires: error
126+
no-multi-assign: error
127+
no-multi-spaces: 'off'
128+
no-multi-str: error
129+
no-multiple-empty-lines: error
130+
no-native-reassign: error
131+
no-negated-condition: 'off'
132+
no-negated-in-lhs: error
133+
no-nested-ternary: error
134+
no-new: error
135+
no-new-func: error
136+
no-new-object: error
137+
no-new-require: error
138+
no-new-wrappers: error
139+
no-octal-escape: error
140+
no-param-reassign: 'off'
141+
no-path-concat: error
142+
no-plusplus: error
143+
no-process-env: error
144+
no-process-exit: error
145+
no-proto: error
146+
no-prototype-builtins: error
147+
no-restricted-globals: error
148+
no-restricted-imports: error
149+
no-restricted-modules: error
150+
no-restricted-properties: error
151+
no-restricted-syntax: error
152+
no-return-assign: error
153+
no-return-await: error
154+
no-script-url: error
155+
no-self-compare: error
156+
no-sequences: error
157+
no-shadow: 'off'
158+
no-shadow-restricted-names: error
159+
no-spaced-func: 'off'
160+
no-sync: error
161+
no-tabs:
162+
- error
163+
- allowIndentationTabs: true
164+
no-template-curly-in-string: error
165+
no-ternary: 'off'
166+
no-throw-literal: error
167+
no-trailing-spaces: 'off'
168+
no-undef-init: 'off'
169+
no-undefined: 'off'
170+
no-underscore-dangle: 'off'
171+
no-unmodified-loop-condition: error
172+
no-unneeded-ternary: error
173+
no-unused-vars: 'warn'
174+
no-unused-expressions: error
175+
no-use-before-define: 'off'
176+
no-useless-call: error
177+
no-useless-catch: error
178+
no-useless-computed-key: error
179+
no-useless-concat: error
180+
no-useless-constructor: error
181+
no-useless-rename: error
182+
no-useless-return: error
183+
no-var: 'off'
184+
no-void: error
185+
no-warning-comments: 'off'
186+
no-whitespace-before-property: error
187+
no-with: error
188+
object-curly-newline: error
189+
object-curly-spacing: 'off'
190+
object-shorthand: 'off'
191+
one-var: 'off'
192+
one-var-declaration-per-line: error
193+
operator-assignment: 'off'
194+
operator-linebreak: 'off'
195+
padded-blocks: 'off'
196+
padding-line-between-statements: error
197+
prefer-arrow-callback: 'off'
198+
prefer-const: 'off'
199+
prefer-destructuring: 'off'
200+
prefer-named-capture-group: error
201+
prefer-numeric-literals: error
202+
prefer-object-spread: error
203+
prefer-promise-reject-errors: error
204+
prefer-reflect: 'off'
205+
prefer-rest-params: error
206+
prefer-spread: error
207+
prefer-template: 'off'
208+
quote-props: 'off'
209+
quotes: 'off'
210+
radix: 'off'
211+
require-atomic-updates: error
212+
require-await: error
213+
require-jsdoc: 'off'
214+
require-unicode-regexp: 'off'
215+
rest-spread-spacing: error
216+
semi: 'off'
217+
semi-spacing: error
218+
semi-style:
219+
- error
220+
- last
221+
sort-imports: error
222+
sort-keys: 'off'
223+
sort-vars: error
224+
space-before-blocks: 'off'
225+
space-before-function-paren: 'off'
226+
space-in-parens: 'off'
227+
space-infix-ops: 'off'
228+
space-unary-ops: error
229+
spaced-comment: 'off'
230+
strict: error
231+
switch-colon-spacing: error
232+
symbol-description: error
233+
template-curly-spacing:
234+
- error
235+
- never
236+
template-tag-spacing: error
237+
unicode-bom:
238+
- error
239+
- never
240+
valid-jsdoc: 'off'
241+
vars-on-top: 'off'
242+
wrap-iife: error
243+
wrap-regex: error
244+
yield-star-spacing: error
245+
yoda:
246+
- error
247+
- never

.github/ISSUE_TEMPLATE/bug_report.md

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
name: Bug report
3+
about: Bug report
4+
title: "[BUG]"
5+
labels: bug
6+
assignees: ''
7+
8+
---
9+
10+
>NOTE:
11+
>GNOME will sometimes report errors associated extensions if you manually update them via the extensions website. These errors can be resolved by restarting GNOME shell (logging out and then back in again). If it's still creating errors, then please go ahead create an issue.
12+
13+
**Describe the bug**
14+
A clear and concise description of what the bug is.
15+
16+
**Screenshots**
17+
If applicable, add screenshots to help explain your problem.
18+
19+
**To Reproduce**
20+
Steps to reproduce the behavior:
21+
1. Go to '...'
22+
2. Click on '....'
23+
3. Scroll down to '....'
24+
4. See error
25+
26+
**Desktop (please complete the following information):**
27+
- OS: [e.g. Ubuntu 21.04]
28+
- Extension Version: [e.g. 36]
29+
- GNOME Version: [e.g. 40.0]
30+
31+
**Additional context**
32+
Add any other context about the problem here.

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
.vscode/*
22
*~
33
*.zip
4+
translations.txt
5+

README.md

+18-17
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,46 @@
11
# GNOME Shell extension - Google Earth Wallpaper
22

3-
Lightweight GNOME shell extension to set your wallpaper to a random Google Earth photo from a selection of curated locations (recently to 2604 locations).
3+
![Jiamusi](/screenshot/Jiamusi_China.jpg)
44

5-
*Disclaimer*: this extension is unofficial and not affiliated with Google in any way. Images are protected by copyright, and are licensed only
6-
for use as wallpapers.
5+
[![Get it on GNOME extensions](/screenshot/get_it_on_gnome_extensions.png)](https://extensions.gnome.org/extension/1295/google-earth-wallpaper/) [![<3 Sponsor this project on GitHub <3](/screenshot/sponsor.png)](https://github.com/sponsors/neffo)
76

8-
This extension is derived from my [Bing Wallpaper](https://github.com/neffo/bing-wallpaper-gnome-extension) GNOME extension, which was based extensively on the NASA APOD extension by [Elinvention](https://github.com/Elinvention). Curated locations and images come from Google's [Earth View](https://earthview.withgoogle.com/) website and the [associated Chrome extension](https://chrome.google.com/webstore/detail/earth-view-from-google-ea/bhloflhklmhfpedakmangadcdofhnnoh?hl=en).
7+
Lightweight GNOME shell extension to set your wallpaper to a random Google Earth photo from a selection of pool of 2,604 curated locations.
8+
9+
*Disclaimer*: this extension is unofficial and not affiliated with Google in any way. Images are protected by copyright, and are licensed only for use as wallpapers.
910

1011
## Features
1112

12-
* Fetches a random Google Earth wallpaper and sets as desktop wallpaper, lock screen and (finally!) the lock screen password prompt
13+
* Fetches a random Google Earth wallpaper and sets as desktop wallpaper and lock screen
1314
* User selectable refresh intervals (default is once per day)
1415
* Optional: keep images or clean up after (later is default)
1516
* View location on Google Maps, Bing Maps, Gnome Maps, OpenStreetMaps
16-
* Place pin on a map in settings
17-
* Adjustable indicator brightness (to match themes better)
18-
19-
## TODO
20-
21-
* Migrate to Champlain for Map View (in prefs)
22-
* Location relative to user
23-
* Pixel scale
2417

2518
## Requirements
2619

27-
Gnome 3.28+ (Ubuntu Gnome 18.04+)
20+
GNOME Shell 3.38+ (Ubuntu Gnome 21.04+), legacy support exists for earlier GNOME Shell versions (3.28+)
2821

2922
## Install
3023

3124
[Install from extensions.gnome.org](https://extensions.gnome.org/extension/1295/google-earth-wallpaper/)
3225

3326
or install directly to your GNOME extensions directory (if you want to hack on it)
3427

35-
`git clone https://github.com/neffo/earth-view-wallpaper-gnome-extension.git $HOME/.local/share/gnome-shell/extensions/[email protected]`
28+
```
29+
mkdir ~/source
30+
cd ~/source
31+
git clone https://github.com/neffo/earth-view-wallpaper-gnome-extension.git
32+
cd earth-view-wallpaper-gnome-extension
33+
sh install.sh
34+
```
35+
36+
## Other works
37+
38+
This extension is derived from my [Bing Wallpaper](https://github.com/neffo/bing-wallpaper-gnome-extension) GNOME extension, which was based extensively on the NASA APOD extension by [Elinvention](https://github.com/Elinvention). Curated locations and images come from Google's [Earth View](https://earthview.withgoogle.com/) website and the [associated Chrome extension](https://chrome.google.com/webstore/detail/earth-view-from-google-ea/bhloflhklmhfpedakmangadcdofhnnoh?hl=en).
3639

3740
## Screenshots
3841

3942
![Menu](/screenshot/menu.png)
4043

4144
![Settings](/screenshot/settings.png)
4245

43-
![About Page](/screenshot/map.png)
44-
4546
![Lockscreen](/screenshot/lockscreen-dialog.jpg)

buildzip.sh

+13-6
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,24 @@
11
#!/bin/bash
22

3+
4+
ZIP_NAME=$EXTENSION_NAME.zip
5+
6+
# stop build if this doesn't work
7+
npm --version && (npm test; if [ $? -ne 0 ]; then exit 1; fi)
8+
39
glib-compile-schemas schemas/
4-
intltool-extract --type=gettext/glade Settings.ui
5-
xgettext -k -k_ -kN_ -o locale/GoogleEarthWallpaper.pot Settings.ui.h extension.js prefs.js utils.js --from-code=UTF-8
10+
intltool-extract --type=gettext/glade ui/Settings.ui
11+
intltool-extract --type=gettext/glade ui/Settings4.ui
12+
xgettext -k -k_ -kN_ -o locale/GoogleEarthWallpaper.pot ui/Settings.ui.h ui/Settings4.ui.h extension.js prefs.js utils.js --from-code=UTF-8
613

714
for D in locale/*; do
815
if [ -d "${D}" ]; then
9-
msgfmt -o "${D}/LC_MESSAGES/GoogleEarthWallpaper.mo" "${D}/LC_MESSAGES/GoogleEarthWallpaper.po" # compile translations
16+
msgfmt --statistics --template=locale/GoogleEarthWallpaper.pot --verbose -o "${D}/LC_MESSAGES/GoogleEarthWallpaper.mo" "${D}/LC_MESSAGES/GoogleEarthWallpaper.po" 2> translations.txt # compile translations
1017
fi
1118
done
1219

13-
20+
rm $ZIP_NAME
1421

15-
22+
zip -r $ZIP_NAME *
1623

17-
zip -d [email protected] screenshot/* screenshot buildzip.sh Settings.ui.h *.py *~
24+
zip -d $ZIP_NAME screenshot/* screenshot buildzip.sh Settings.ui.h *.py *~ *.sh .* translations.txt *.h package.json *.yaml *.po *.pot

convenience.js

+2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
/* -*- mode: js; js-basic-offset: 4; indent-tabs-mode: nil -*- */
2+
/*global imports*/
3+
/*eslint no-unused-vars: "off"*/
24
/*
35
Copyright (c) 2011-2012, Giovanni Campagna <[email protected]>
46

0 commit comments

Comments
 (0)