Skip to content

Commit

Permalink
remove monitor size check, bump extension version
Browse files Browse the repository at this point in the history
  • Loading branch information
neffo committed Jan 17, 2021
1 parent 41037c7 commit fda577b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 32 deletions.
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@ or create a zip file by doing this

You can then install this file using the Gnome Tweak Tool. Please note to install an extension correctly the zip must have the metadata.json file in the base directory (not in a sub-directory), so you can't use the Git zip file to do this.

Heres a suitable [zip file](https://neffo.github.io/[email protected]) I prepared earlier.

## Screenshots

![Screenshot](/screenshot/notification.png)
Expand Down
28 changes: 1 addition & 27 deletions extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,8 @@ const TIMEOUT_SECONDS = 24 * 3600; // FIXME: this should use the end data from t
const TIMEOUT_SECONDS_ON_HTTP_ERROR = 1 * 3600; // retry in one hour if there is a http error
const ICON_DEFAULT = "simple-frame";

let monitors;
let validresolutions = [ '800x600' , '1024x768', '1280x720', '1280x768', '1366x768', '1920x1080', '1920x1200', 'UHD'];
let aspectratios = [ -1, 1.33, -1, 1.67, 1.78, 1.78, 1.6, -1]; // width / height (ignore the lower res equivalents)

let monitorW; // largest (in pixels) monitor width
let monitorH; // largest (in pixels) monitor height
let autores; // automatically selected resolution

let bingWallpaperIndicator=null;
Expand Down Expand Up @@ -552,29 +548,7 @@ function init(extensionMeta) {
function enable() {
bingWallpaperIndicator = new BingWallpaperIndicator();
Main.panel.addToStatusArea(IndicatorName, bingWallpaperIndicator);
monitors = Main.layoutManager.monitors; // get list of connected monitors (and sizes)
let largest = 0;
for (let monitorIdx in monitors) {
let monitor = monitors[monitorIdx];
log("monitor "+monitorIdx+" -> "+monitor.width+" x "+monitor.height);
if ((monitor.width * monitor.height) > largest) {
monitorW = monitor.width;
monitorH = monitor.height;
largest = monitorW * monitorH;
}
}

log("highest res: "+monitorW+" x "+monitorH);
autores = monitorW+"x"+monitorH;

if (validresolutions.indexOf(autores) == -1) {
// default to 1080, as people don't like the Bing logo
autores = monitorW > 1920 ? "UHD" : "1920x1080";
log("unknown resolution, defaulted to "+autores);
}
else {
log("detected best resolution "+autores);
}
autores = "UHD"; // remove monitor size checks
}

function disable() {
Expand Down
6 changes: 3 additions & 3 deletions metadata.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"uuid": "[email protected]",
"shell-version": ["3.28", "3.30", "3.32", "3.34", "3.36"],
"shell-version": ["3.28", "3.30", "3.32", "3.34", "3.36", "3.38"],
"name": "Bing Wallpaper",
"settings-schema": "org.gnome.shell.extensions.bingwallpaper",
"description": "Lightweight GNOME shell extension to set your wallpaper once per day to today's Microsoft Bing image of the day (the image you see when you visit Bing.com).\n\n *Disclaimer*: this extension is unofficial and not affiliated with Bing or Microsoft in any way. Images are protected by copyright and are licensed only for use as wallpapers.\n\nThis extension is based extensively on the NASA APOD extension by Elinvention (https://github.com/Elinvention) and inspired by Bing Desktop Wallpaper Changer by Utkarsh Gupta (https://github.com/UtkarshGpta).\n\nFeatures:\n* Fetches the Bing wallpaper of the day and sets as both lock screen and desktop wallpaper (these are both user selectable)\n* Optionally force a specific region (i.e. locale)\n* Automatically selects the highest resolution (and most appropriate wallpaper) in multiple monitor setups\n* Optionally clean up Wallpaper directory after between 1 and 7 days (delete oldest first)\n* Only attempts to download wallpapers when they have been updated\n* Doesn't poll continuously - only once per day and on startup (schedules a refresh when Bing is due to update)\n* English (en), German (de), Dutch (nl), Italian (it), Polish (pl), Chinese (zh_CN, zh_TW), French (fr_FR), Portuguese (pt, pt_BR), Russian (ru_RU), Spanish (es), Korean (ko, ko_KR, ko_KP), Indonesian (id), Catalan (ca) and Norwegian Bokmål & Nynorsk - a HUGE thanks to the translators\n\nPlease report bugs to the GitHub page below",
"version": "27",
"description": "Lightweight GNOME shell extension to set your wallpaper once per day to today's Microsoft Bing image of the day (the image you see when you visit Bing.com).\n\n *Disclaimer*: this extension is unofficial and not affiliated with Bing or Microsoft in any way. Images are protected by copyright and are licensed only for use as wallpapers.\n\nThis extension is based extensively on the NASA APOD extension by Elinvention (https://github.com/Elinvention) and inspired by Bing Desktop Wallpaper Changer by Utkarsh Gupta (https://github.com/UtkarshGpta).\n\nFeatures:\n* Fetches the Bing wallpaper of the day and sets as both lock screen and desktop wallpaper (these are both user selectable)\n* Optionally force a specific region (i.e. locale)\n* Automatically selects the highest resolution (and most appropriate wallpaper) in multiple monitor setups\n* Optionally clean up Wallpaper directory after between 1 and 7 days (delete oldest first)\n* Only attempts to download wallpapers when they have been updated\n* Doesn't poll continuously - only once per day and on startup (schedules a refresh when Bing is due to update)\n* English (en), German (de), Dutch (nl), Italian (it), Polish (pl), Chinese (zh_CN), French (fr_FR), Portuguese (pt, pt_BR), Russian (ru_RU), Spanish (es), Korean (ko, ko_KR, ko_KP), Indonesian (id), Catalan (ca), Norwegian Bokmål (nb) & Nynorsk (ni), Swedish (sv) and Arabic (ar) - a HUGE thanks to the translators\n\nPlease report bugs to the GitHub page below:",
"version": "28",
"url": "https://github.com/neffo/bing-wallpaper-gnome-extension"
}

0 comments on commit fda577b

Please sign in to comment.