diff --git a/cinnamon-dynamic-wallpaper@TobiZog/extension.js b/cinnamon-dynamic-wallpaper@TobiZog/extension.js index d66fcf2..b601b4c 100644 --- a/cinnamon-dynamic-wallpaper@TobiZog/extension.js +++ b/cinnamon-dynamic-wallpaper@TobiZog/extension.js @@ -71,6 +71,7 @@ CinnamonDynamicWallpaperExtension.prototype = { 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.setImageToTime() @@ -163,7 +164,23 @@ CinnamonDynamicWallpaperExtension.prototype = { lastDayTime = i break } - } + } + + + function convertToTimeString(time) { + return time.getHours().toString().padStart(2, "0") + ":" + time.getMinutes().toString().padStart(2, "0") + } + + this.tvTimes = + "Morning Twilight:\t\t" + convertToTimeString(timesArray[0][0]) + " - " + convertToTimeString(timesArray[0][1]) + + "\nSunrise:\t\t\t\t" + convertToTimeString(timesArray[1][0]) + " - " + convertToTimeString(timesArray[1][1]) + + "\nMorning:\t\t\t" + convertToTimeString(timesArray[2][0]) + " - " + convertToTimeString(timesArray[2][1]) + + "\nNoon:\t\t\t\t" + convertToTimeString(timesArray[3][0]) + " - " + convertToTimeString(timesArray[3][1]) + + "\nAfternoon:\t\t\t" + convertToTimeString(timesArray[4][0]) + " - " + convertToTimeString(timesArray[4][1]) + + "\nEvening:\t\t\t" + convertToTimeString(timesArray[5][0]) + " - " + convertToTimeString(timesArray[5][1]) + + "\nSunset:\t\t\t\t" + convertToTimeString(timesArray[6][0]) + " - " + convertToTimeString(timesArray[6][1]) + + "\nNight Twilight:\t\t" + convertToTimeString(timesArray[7][0]) + " - " + convertToTimeString(timesArray[7][1]) + + "\nNight:\t\t\t\t" + convertToTimeString(timesArray[8][0]) + " - " + convertToTimeString(timesArray[8][1]) }, diff --git a/cinnamon-dynamic-wallpaper@TobiZog/settings-schema.json b/cinnamon-dynamic-wallpaper@TobiZog/settings-schema.json index d7ff105..76927ad 100644 --- a/cinnamon-dynamic-wallpaper@TobiZog/settings-schema.json +++ b/cinnamon-dynamic-wallpaper@TobiZog/settings-schema.json @@ -10,7 +10,8 @@ "title": "Configuration", "sections": [ "sec_image_configuration", - "sec_location" + "sec_location", + "sec_times" ] }, "pg_about": { @@ -39,6 +40,13 @@ "etr_longitude" ] }, + "sec_times": { + "type": "section", + "title": "Time periods", + "keys": [ + "tv_times" + ] + }, "sec_project": { "type": "section", "title": "About the project", @@ -91,6 +99,11 @@ "description": "Longitude", "dependency": "!sw_auto_location" }, + "tv_times": { + "type": "textview", + "description": "Time sections today", + "default": "" + }, "lb_about": { "type": "label", "description": "Based on a location, this extension calculates the periods of a day and switch the background image of your Cinnamon desktop. The extension offers the choice between a set of predownloaded wallpapers or to select a custom set of images." diff --git a/readme.md b/readme.md new file mode 100644 index 0000000..564f9c6 --- /dev/null +++ b/readme.md @@ -0,0 +1,28 @@ +# Cinnamon Dynamic Wallpaper + +![](res/wallpaper_merged.jpg) + +## About the project +Based on a location, this extension calculates the periods of a day and switches the background image of your Cinnamon desktop. The extension offers the choice between a set of included wallpapers or to select a HEIC-file. + +## 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 +1. Open "Extensions" in Linux Mint or any other distribution with Cinnamon as Desktop Environment +2. Click on "Download" +3. Search and download it + +## How to use it +1. Active the Extension via Cinnamon Extension Manager +2. Open the settings +3. Keep `Estimate coordinates via network` active or disable it and insert latitude and longitude in the fields +4. Choose a set of images or disable it and select for every daytime an image manually + +## Image Configurator +![](res/image_configurator.png) + +The Cinnamon Dynamic Wallpaper extension offers an included image configuration assistant. Here, you can choose an included image set, or import a HEIC-file from your system. You have to choose the images for the time periods after the import. diff --git a/res/image_configurator.png b/res/image_configurator.png new file mode 100644 index 0000000..12a4378 Binary files /dev/null and b/res/image_configurator.png differ diff --git a/res/wallpaper_merged.jpg b/res/wallpaper_merged.jpg new file mode 100644 index 0000000..1f68e6f Binary files /dev/null and b/res/wallpaper_merged.jpg differ