2 Commits
v.1.2 ... v.1.3

Author SHA1 Message Date
0d8fa6449c Version Update 2023-07-24 23:36:25 +02:00
8aae370bf8 Adding option to stretch the image over multiple displays 2023-07-24 23:22:16 +02:00
5 changed files with 63 additions and 26 deletions

View File

@@ -1,3 +1,6 @@
# Version 1.3
- Adding option to stretch the image over multiple displays
# Version 1.2 # Version 1.2
- Compatibility with Cinnamon 4.8 and higher - Compatibility with Cinnamon 4.8 and higher
- Notification on first start - Notification on first start

View File

@@ -12,6 +12,7 @@ Based on a location, this extension calculates the periods of a day and switches
- Image configuration assistent with simple one-click setup for image choose - Image configuration assistent with simple one-click setup for image choose
- Online location estimation or offline with manual latitude and longitude input - Online location estimation or offline with manual latitude and longitude input
- Offline sun angles estimation - Offline sun angles estimation
- Image stretching over multiple displays or repeat image for every display
### Tested Cinnamon versions ### Tested Cinnamon versions
- 4.8 (Mint 20.1) - 4.8 (Mint 20.1)
@@ -30,11 +31,6 @@ Based on a location, this extension calculates the periods of a day and switches
- Image Configurator UI was written with `Glade` - Image Configurator UI was written with `Glade`
## Installation ## Installation
### From the repo
1. Download the Repository
2. Extract the files
3. Copy the folder `cinnamon-dynamic-wallpaper@TobiZog` to `~/.local/share/cinnamon/extensions/`
### From Built-in Extension Manager ### From Built-in Extension Manager
![](res/download-manager.png) ![](res/download-manager.png)
@@ -42,6 +38,11 @@ Based on a location, this extension calculates the periods of a day and switches
2. Click on "Download" 2. Click on "Download"
3. Search and download it 3. Search and download it
### From the repo
1. Download the Repository
2. Extract the files
3. Copy the folder `cinnamon-dynamic-wallpaper@TobiZog` to `~/.local/share/cinnamon/extensions/`
## How to use it ## How to use it
1. Active the Extension via Cinnamon Extension Manager 1. Active the Extension via Cinnamon Extension Manager
2. Open the settings 2. Open the settings
@@ -59,12 +60,12 @@ The image sets are from https://github.com/adi1090x/dynamic-wallpaper
| Aurora | Beach | Bitday | | Aurora | Beach | Bitday |
| ------ | ----- | ------ | | ------ | ----- | ------ |
| ![](cinnamon-dynamic-wallpaper@TobiZog/images/included_image_sets/aurora/5.jpg) | ![](cinnamon-dynamic-wallpaper@TobiZog/images/included_image_sets/beach/4.jpg) | ![](cinnamon-dynamic-wallpaper@TobiZog/images/included_image_sets/bitday/4.jpg) | | ![](cinnamon-dynamic-wallpaper@TobiZog/5.4/images/included_image_sets/aurora/5.jpg) | ![](cinnamon-dynamic-wallpaper@TobiZog/5.4/images/included_image_sets/beach/4.jpg) | ![](cinnamon-dynamic-wallpaper@TobiZog/5.4/images/included_image_sets/bitday/4.jpg) |
| Cliffs | Gradient | Lakeside | | Cliffs | Gradient | Lakeside |
| -------- | --------- | ------ | | -------- | --------- | ------ |
| ![](cinnamon-dynamic-wallpaper@TobiZog/images/included_image_sets/cliffs/4.jpg) | ![](cinnamon-dynamic-wallpaper@TobiZog/images/included_image_sets/gradient/4.jpg) | ![](cinnamon-dynamic-wallpaper@TobiZog/images/included_image_sets/lakeside/4.jpg) | | ![](cinnamon-dynamic-wallpaper@TobiZog/5.4/images/included_image_sets/cliffs/4.jpg) | ![](cinnamon-dynamic-wallpaper@TobiZog/5.4/images/included_image_sets/gradient/4.jpg) | ![](cinnamon-dynamic-wallpaper@TobiZog/5.4/images/included_image_sets/lakeside/4.jpg) |
| Mountains | Sahara | | Mountains | Sahara |
| --------- | ------ | | --------- | ------ |
| ![](cinnamon-dynamic-wallpaper@TobiZog/images/included_image_sets/mountains/4.jpg) | ![](cinnamon-dynamic-wallpaper@TobiZog/images/included_image_sets/sahara/4.jpg) | | ![](cinnamon-dynamic-wallpaper@TobiZog/5.4/images/included_image_sets/mountains/4.jpg) | ![](cinnamon-dynamic-wallpaper@TobiZog/5.4/images/included_image_sets/sahara/4.jpg) |

View File

@@ -58,21 +58,30 @@ CinnamonDynamicWallpaperExtension.prototype = {
_init: function(uuid) { _init: function(uuid) {
this.settings = new Settings.ExtensionSettings(this, uuid); this.settings = new Settings.ExtensionSettings(this, uuid);
this.bindSettings("sw_auto_location", "autolocation", this.updateLocation) // Image set
this.bindSettings("sc_location_refresh_time", "locationRefreshTime") this.bindSettings("sw_image_stretch", "imageStretch", this.settingsUpdated)
this.bindSettings("etr_latitude", "latitude", this.updateLocation)
this.bindSettings("etr_longitude", "longitude", this.updateLocation) // Location estimation
this.bindSettings("etr_img_morning_twilight", "img_morning_twilight", this.setImageToTime) this.bindSettings("sw_auto_location", "autolocation", this.settingsUpdated)
this.bindSettings("etr_img_sunrise", "img_sunrise", this.setImageToTime) this.bindSettings("sc_location_refresh_time", "locationRefreshTime", this.settingsUpdated)
this.bindSettings("etr_img_morning", "img_morning", this.setImageToTime) this.bindSettings("etr_latitude", "latitude", this.settingsUpdated)
this.bindSettings("etr_img_noon", "img_noon", this.setImageToTime) this.bindSettings("etr_longitude", "longitude", this.settingsUpdated)
this.bindSettings("etr_img_afternoon", "img_afternoon", this.setImageToTime)
this.bindSettings("etr_img_evening", "img_evening", this.setImageToTime) // Time periods
this.bindSettings("etr_img_sunset", "img_sunset", this.setImageToTime)
this.bindSettings("etr_img_night_twilight", "img_night_twilight", this.setImageToTime)
this.bindSettings("etr_img_night", "img_night", this.setImageToTime)
this.bindSettings("tv_times", "tvTimes") this.bindSettings("tv_times", "tvTimes")
// Image Configurator
this.bindSettings("etr_img_morning_twilight", "img_morning_twilight", this.settingsUpdated)
this.bindSettings("etr_img_sunrise", "img_sunrise", this.settingsUpdated)
this.bindSettings("etr_img_morning", "img_morning", this.settingsUpdated)
this.bindSettings("etr_img_noon", "img_noon", this.settingsUpdated)
this.bindSettings("etr_img_afternoon", "img_afternoon", this.settingsUpdated)
this.bindSettings("etr_img_evening", "img_evening", this.settingsUpdated)
this.bindSettings("etr_img_sunset", "img_sunset", this.settingsUpdated)
this.bindSettings("etr_img_night_twilight", "img_night_twilight", this.settingsUpdated)
this.bindSettings("etr_img_night", "img_night", this.settingsUpdated)
// Check for the first startup // Check for the first startup
if (this.settings.getValue("first_start")) { if (this.settings.getValue("first_start")) {
// Welcome notification // Welcome notification
@@ -118,6 +127,18 @@ CinnamonDynamicWallpaperExtension.prototype = {
) )
}, },
/**
* Handles changes in settings
*/
settingsUpdated: function() {
lastDayTime = suntimes.DAYPERIOD.NONE
this.updateLocation()
this.setImageToTime()
},
/** /**
* Displaying a desktop notification * Displaying a desktop notification
* *
@@ -165,6 +186,15 @@ CinnamonDynamicWallpaperExtension.prototype = {
changeWallpaper: function(imageURI) { changeWallpaper: function(imageURI) {
let gSetting = new Gio.Settings({schema: 'org.cinnamon.desktop.background'}); let gSetting = new Gio.Settings({schema: 'org.cinnamon.desktop.background'});
gSetting.set_string('picture-uri', imageURI); gSetting.set_string('picture-uri', imageURI);
if (this.imageStretch) {
gSetting.set_string('picture-options', 'spanned')
}
else
{
gSetting.set_string('picture-options', 'zoom')
}
Gio.Settings.sync(); Gio.Settings.sync();
gSetting.apply(); gSetting.apply();
}, },
@@ -229,9 +259,6 @@ CinnamonDynamicWallpaperExtension.prototype = {
this.longitude = this.longitude this.longitude = this.longitude
} }
// Refresh the image information, if it's necessary
this.setImageToTime()
// Update the update information // Update the update information
lastLocationUpdate = new Date() lastLocationUpdate = new Date()
}, },

View File

@@ -30,7 +30,8 @@
"title": "Image set", "title": "Image set",
"keys": [ "keys": [
"lb_image_configuration", "lb_image_configuration",
"btn_config_images" "btn_config_images",
"sw_image_stretch"
] ]
}, },
"sec_location": { "sec_location": {
@@ -88,6 +89,11 @@
"description": "Image Configurator", "description": "Image Configurator",
"callback": "openImageConfigurator" "callback": "openImageConfigurator"
}, },
"sw_image_stretch": {
"type": "switch",
"description": "Expand image over all displays",
"default": true
},
"sw_auto_location": { "sw_auto_location": {
"type": "switch", "type": "switch",
"default": true, "default": true,

View File

@@ -2,7 +2,7 @@
"uuid": "cinnamon-dynamic-wallpaper@TobiZog", "uuid": "cinnamon-dynamic-wallpaper@TobiZog",
"name": "Cinnamon Dynamic Wallpaper", "name": "Cinnamon Dynamic Wallpaper",
"description": "Cinnamon extension for dynamic desktop backgrounds based on time and location", "description": "Cinnamon extension for dynamic desktop backgrounds based on time and location",
"version": "1.2", "version": "1.3",
"multiversion": true, "multiversion": true,
"cinnamon-version": [ "cinnamon-version": [
"4.8", "4.8",