Skip to content

Commit

Permalink
Merge pull request #26 from neffo/version-13
Browse files Browse the repository at this point in the history
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
  • Loading branch information
neffo authored Oct 24, 2021
2 parents 37117e9 + 619e0d8 commit 0de887b
Show file tree
Hide file tree
Showing 21 changed files with 624 additions and 318 deletions.
247 changes: 247 additions & 0 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,247 @@
env:
browser: true
es6: true
extends: 'eslint:recommended'
globals:
Atomics: readonly
SharedArrayBuffer: readonly
parserOptions:
ecmaVersion: 2018
sourceType: module
rules:
accessor-pairs: error
array-bracket-newline: 'off'
array-bracket-spacing: 'off'
array-callback-return: error
array-element-newline: 'off'
arrow-body-style: error
arrow-parens: 'off'
arrow-spacing:
- error
- after: true
before: true
block-scoped-var: error
block-spacing: error
brace-style: 'off'
callback-return: error
camelcase: 'off'
capitalized-comments: 'off'
class-methods-use-this: error
comma-dangle: error
comma-spacing: 'off'
comma-style:
- error
- last
complexity: error
computed-property-spacing:
- error
- never
consistent-return: error
consistent-this: error
curly: 'off'
default-case: error
dot-location: error
dot-notation: 'off'
eol-last: 'off'
eqeqeq: 'off'
func-call-spacing: 'off'
func-name-matching: error
func-names: 'off'
func-style: 'off'
function-paren-newline: 'off'
generator-star-spacing: error
global-require: error
guard-for-in: 'off'
handle-callback-err: error
id-blacklist: error
id-length: 'off'
id-match: error
implicit-arrow-linebreak: 'off'
indent: 'off'
indent-legacy: 'off'
init-declarations: 'off'
jsx-quotes: error
key-spacing: 'off'
keyword-spacing: 'off'
line-comment-position: 'off'
linebreak-style:
- error
- unix
lines-around-comment: 'off'
lines-around-directive: error
lines-between-class-members:
- error
- always
max-classes-per-file: error
max-depth: error
max-len: 'off'
max-lines: 'off'
max-lines-per-function: 'off'
max-nested-callbacks: error
max-params: 'off'
max-statements: 'off'
max-statements-per-line: error
multiline-comment-style: 'off'
new-cap: error
new-parens: error
newline-after-var: 'off'
newline-before-return: 'off'
newline-per-chained-call: 'off'
no-alert: error
no-array-constructor: error
no-async-promise-executor: error
no-await-in-loop: error
no-bitwise: 'off'
no-buffer-constructor: error
no-caller: error
no-catch-shadow: error
no-confusing-arrow: 'off'
no-continue: error
no-div-regex: error
no-duplicate-imports: error
no-else-return: 'off'
no-empty-function: error
no-eq-null: 'off'
no-eval: error
no-extend-native: error
no-extra-bind: error
no-extra-label: error
no-extra-parens: 'off'
no-floating-decimal: error
no-implicit-coercion: error
no-implicit-globals: error
no-implied-eval: error
no-inline-comments: 'off'
no-invalid-this: 'off'
no-iterator: error
no-label-var: error
no-labels: error
no-lone-blocks: error
no-lonely-if: error
no-loop-func: error
no-magic-numbers: 'off'
no-misleading-character-class: error
no-mixed-operators: error
no-mixed-requires: error
no-multi-assign: error
no-multi-spaces: 'off'
no-multi-str: error
no-multiple-empty-lines: error
no-native-reassign: error
no-negated-condition: 'off'
no-negated-in-lhs: error
no-nested-ternary: error
no-new: error
no-new-func: error
no-new-object: error
no-new-require: error
no-new-wrappers: error
no-octal-escape: error
no-param-reassign: 'off'
no-path-concat: error
no-plusplus: error
no-process-env: error
no-process-exit: error
no-proto: error
no-prototype-builtins: error
no-restricted-globals: error
no-restricted-imports: error
no-restricted-modules: error
no-restricted-properties: error
no-restricted-syntax: error
no-return-assign: error
no-return-await: error
no-script-url: error
no-self-compare: error
no-sequences: error
no-shadow: 'off'
no-shadow-restricted-names: error
no-spaced-func: 'off'
no-sync: error
no-tabs:
- error
- allowIndentationTabs: true
no-template-curly-in-string: error
no-ternary: 'off'
no-throw-literal: error
no-trailing-spaces: 'off'
no-undef-init: 'off'
no-undefined: 'off'
no-underscore-dangle: 'off'
no-unmodified-loop-condition: error
no-unneeded-ternary: error
no-unused-vars: 'warn'
no-unused-expressions: error
no-use-before-define: 'off'
no-useless-call: error
no-useless-catch: error
no-useless-computed-key: error
no-useless-concat: error
no-useless-constructor: error
no-useless-rename: error
no-useless-return: error
no-var: 'off'
no-void: error
no-warning-comments: 'off'
no-whitespace-before-property: error
no-with: error
object-curly-newline: error
object-curly-spacing: 'off'
object-shorthand: 'off'
one-var: 'off'
one-var-declaration-per-line: error
operator-assignment: 'off'
operator-linebreak: 'off'
padded-blocks: 'off'
padding-line-between-statements: error
prefer-arrow-callback: 'off'
prefer-const: 'off'
prefer-destructuring: 'off'
prefer-named-capture-group: error
prefer-numeric-literals: error
prefer-object-spread: error
prefer-promise-reject-errors: error
prefer-reflect: 'off'
prefer-rest-params: error
prefer-spread: error
prefer-template: 'off'
quote-props: 'off'
quotes: 'off'
radix: 'off'
require-atomic-updates: error
require-await: error
require-jsdoc: 'off'
require-unicode-regexp: 'off'
rest-spread-spacing: error
semi: 'off'
semi-spacing: error
semi-style:
- error
- last
sort-imports: error
sort-keys: 'off'
sort-vars: error
space-before-blocks: 'off'
space-before-function-paren: 'off'
space-in-parens: 'off'
space-infix-ops: 'off'
space-unary-ops: error
spaced-comment: 'off'
strict: error
switch-colon-spacing: error
symbol-description: error
template-curly-spacing:
- error
- never
template-tag-spacing: error
unicode-bom:
- error
- never
valid-jsdoc: 'off'
vars-on-top: 'off'
wrap-iife: error
wrap-regex: error
yield-star-spacing: error
yoda:
- error
- never
32 changes: 32 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
name: Bug report
about: Bug report
title: "[BUG]"
labels: bug
assignees: ''

---

>NOTE:
>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.
**Describe the bug**
A clear and concise description of what the bug is.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Desktop (please complete the following information):**
- OS: [e.g. Ubuntu 21.04]
- Extension Version: [e.g. 36]
- GNOME Version: [e.g. 40.0]

**Additional context**
Add any other context about the problem here.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.vscode/*
*~
*.zip
translations.txt

35 changes: 18 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,45 +1,46 @@
# GNOME Shell extension - Google Earth Wallpaper

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

*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.
[![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)

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).
Lightweight GNOME shell extension to set your wallpaper to a random Google Earth photo from a selection of pool of 2,604 curated locations.

*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.

## Features

* Fetches a random Google Earth wallpaper and sets as desktop wallpaper, lock screen and (finally!) the lock screen password prompt
* Fetches a random Google Earth wallpaper and sets as desktop wallpaper and lock screen
* User selectable refresh intervals (default is once per day)
* Optional: keep images or clean up after (later is default)
* View location on Google Maps, Bing Maps, Gnome Maps, OpenStreetMaps
* Place pin on a map in settings
* Adjustable indicator brightness (to match themes better)

## TODO

* Migrate to Champlain for Map View (in prefs)
* Location relative to user
* Pixel scale

## Requirements

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

## Install

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

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

`git clone https://github.com/neffo/earth-view-wallpaper-gnome-extension.git $HOME/.local/share/gnome-shell/extensions/GoogleEarthWallpaper@neffo.github.com`
```
mkdir ~/source
cd ~/source
git clone https://github.com/neffo/earth-view-wallpaper-gnome-extension.git
cd earth-view-wallpaper-gnome-extension
sh install.sh
```

## Other works

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).

## Screenshots

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

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

![About Page](/screenshot/map.png)

![Lockscreen](/screenshot/lockscreen-dialog.jpg)
19 changes: 13 additions & 6 deletions buildzip.sh
Original file line number Diff line number Diff line change
@@ -1,17 +1,24 @@
#!/bin/bash

EXTENSION_NAME=GoogleEarthWallpaper@neffo.github.com
ZIP_NAME=$EXTENSION_NAME.zip

# stop build if this doesn't work
npm --version && (npm test; if [ $? -ne 0 ]; then exit 1; fi)

glib-compile-schemas schemas/
intltool-extract --type=gettext/glade Settings.ui
xgettext -k -k_ -kN_ -o locale/GoogleEarthWallpaper.pot Settings.ui.h extension.js prefs.js utils.js --from-code=UTF-8
intltool-extract --type=gettext/glade ui/Settings.ui
intltool-extract --type=gettext/glade ui/Settings4.ui
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

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

rm GoogleEarthWallpaper@neffo.github.com.zip
rm $ZIP_NAME

zip -r GoogleEarthWallpaper@neffo.github.com.zip *
zip -r $ZIP_NAME *

zip -d GoogleEarthWallpaper@neffo.github.com.zip screenshot/* screenshot buildzip.sh Settings.ui.h *.py *~
zip -d $ZIP_NAME screenshot/* screenshot buildzip.sh Settings.ui.h *.py *~ *.sh .* translations.txt *.h package.json *.yaml *.po *.pot
2 changes: 2 additions & 0 deletions convenience.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
/* -*- mode: js; js-basic-offset: 4; indent-tabs-mode: nil -*- */
/*global imports*/
/*eslint no-unused-vars: "off"*/
/*
Copyright (c) 2011-2012, Giovanni Campagna <scampa.giovanni@gmail.com>
Expand Down
Loading

0 comments on commit 0de887b

Please sign in to comment.