2 Commits

Author SHA1 Message Date
0ab3297054 Adding support for Login screen wallpaper 2024-02-15 17:04:20 +01:00
45e95d0e2b Readme 2024-02-15 13:20:59 +01:00
9 changed files with 235 additions and 69 deletions

View File

@@ -59,6 +59,17 @@ Because of the lack of configuration options in the standard Cinnamon configurat
All configuration will be handled there. You can choose between included image sets, a HEIC file or a folder source and set the image to ten different daytime periods. Time periods will be estimated via network, custom coordinations or custom time periods. Some behaviour preferences (strech image, fill empty background with gradient color) are also here. All configuration will be handled there. You can choose between included image sets, a HEIC file or a folder source and set the image to ten different daytime periods. Time periods will be estimated via network, custom coordinations or custom time periods. Some behaviour preferences (strech image, fill empty background with gradient color) are also here.
![](res/image_configurator.png) ![](res/image_configurator.png)
---
## Contribute
### Translation
You want to contribute a language which isn't supported yet? Here is how to do:
1. Fork the cinnamon-spices-extensions project: https://github.com/linuxmint/cinnamon-spices-extensions
2. Pull the repository
3. Open `cinnamon-dynamic-wallpaper@TobiZog/files/cinnamon-dynamic-wallpaper@TobiZog/po/cinnamon-dynamic-wallpaper@TobiZog.pot` with a po-tool like poedit (https://poedit.net/).
4. Create a new translation in your language
5. Push the changes to your repository
6. Create a pull request
--- ---
## Included image sets ## Included image sets

View File

@@ -1,7 +1,7 @@
/** /**
* @name Cinnamon-Dynamic-Wallpaper * @name Cinnamon-Dynamic-Wallpaper
* @alias TobiZog * @alias TobiZog
* @since 2023-05-17 * @since 2023-05-17
* *
* @description Main application file * @description Main application file
*/ */
@@ -77,7 +77,7 @@ CinnamonDynamicWallpaperExtension.prototype = {
// Hide the notification on system restart // Hide the notification on system restart
this.settings.setValue("first_start", false) this.settings.setValue("first_start", false)
this.settings.setValue("source_folder", DIRECTORY["path"] + "/images/included_image_sets/lakeside/") this.settings.setValue("source_folder", DIRECTORY["path"] + "/res/images/included_image_sets/lakeside/")
} }
// Start the main loop, checks in fixed time periods the // Start the main loop, checks in fixed time periods the

Binary file not shown.

Before

Width:  |  Height:  |  Size: 201 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 101 KiB

View File

@@ -461,7 +461,7 @@
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="margin-top">16</property> <property name="margin-top">16</property>
<property name="label" translatable="no">label</property> <property name="label">label</property>
<attributes> <attributes>
<attribute name="style" value="italic"/> <attribute name="style" value="italic"/>
</attributes> </attributes>
@@ -517,7 +517,7 @@
<object class="GtkLabel" id="etr_period_1"> <object class="GtkLabel" id="etr_period_1">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="label" translatable="no">00:00 - 00:59</property> <property name="label">00:00 - 00:59</property>
<attributes> <attributes>
<attribute name="size" value="15360"/> <attribute name="size" value="15360"/>
</attributes> </attributes>
@@ -531,7 +531,7 @@
<object class="GtkLabel" id="etr_period_3"> <object class="GtkLabel" id="etr_period_3">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="label" translatable="no">02:00 - 02:59</property> <property name="label">02:00 - 02:59</property>
<attributes> <attributes>
<attribute name="size" value="15360"/> <attribute name="size" value="15360"/>
</attributes> </attributes>
@@ -545,7 +545,7 @@
<object class="GtkLabel" id="etr_period_5"> <object class="GtkLabel" id="etr_period_5">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="label" translatable="no">04:00 - 04:59</property> <property name="label">04:00 - 04:59</property>
<attributes> <attributes>
<attribute name="size" value="15360"/> <attribute name="size" value="15360"/>
</attributes> </attributes>
@@ -559,7 +559,7 @@
<object class="GtkLabel" id="etr_period_7"> <object class="GtkLabel" id="etr_period_7">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="label" translatable="no">06:00 - 06:59</property> <property name="label">06:00 - 06:59</property>
<attributes> <attributes>
<attribute name="size" value="15360"/> <attribute name="size" value="15360"/>
</attributes> </attributes>
@@ -573,7 +573,7 @@
<object class="GtkLabel" id="etr_period_9"> <object class="GtkLabel" id="etr_period_9">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="label" translatable="no">08:00 - 08:59</property> <property name="label">08:00 - 08:59</property>
<attributes> <attributes>
<attribute name="size" value="15360"/> <attribute name="size" value="15360"/>
</attributes> </attributes>
@@ -789,7 +789,7 @@
<object class="GtkLabel" id="etr_period_2"> <object class="GtkLabel" id="etr_period_2">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="label" translatable="no">01:00 - 01:59</property> <property name="label">01:00 - 01:59</property>
<attributes> <attributes>
<attribute name="size" value="15360"/> <attribute name="size" value="15360"/>
</attributes> </attributes>
@@ -803,7 +803,7 @@
<object class="GtkLabel" id="etr_period_4"> <object class="GtkLabel" id="etr_period_4">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="label" translatable="no">03:00 - 03:59</property> <property name="label">03:00 - 03:59</property>
<attributes> <attributes>
<attribute name="size" value="15360"/> <attribute name="size" value="15360"/>
</attributes> </attributes>
@@ -817,7 +817,7 @@
<object class="GtkLabel" id="etr_period_6"> <object class="GtkLabel" id="etr_period_6">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="label" translatable="no">05:00 - 05:59</property> <property name="label">05:00 - 05:59</property>
<attributes> <attributes>
<attribute name="size" value="15360"/> <attribute name="size" value="15360"/>
</attributes> </attributes>
@@ -831,7 +831,7 @@
<object class="GtkLabel" id="etr_period_8"> <object class="GtkLabel" id="etr_period_8">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="label" translatable="no">07:00 - 07:59</property> <property name="label">07:00 - 07:59</property>
<attributes> <attributes>
<attribute name="size" value="15360"/> <attribute name="size" value="15360"/>
</attributes> </attributes>
@@ -845,7 +845,7 @@
<object class="GtkLabel" id="etr_period_10"> <object class="GtkLabel" id="etr_period_10">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="label" translatable="no">09:00 - 09:59</property> <property name="label">09:00 - 09:59</property>
<attributes> <attributes>
<attribute name="size" value="15360"/> <attribute name="size" value="15360"/>
</attributes> </attributes>
@@ -1245,7 +1245,7 @@
<property name="margin-end">8</property> <property name="margin-end">8</property>
<property name="margin-top">8</property> <property name="margin-top">8</property>
<property name="margin-bottom">8</property> <property name="margin-bottom">8</property>
<property name="label" translatable="no">label</property> <property name="label">label</property>
<attributes> <attributes>
<attribute name="style" value="italic"/> <attribute name="style" value="italic"/>
</attributes> </attributes>
@@ -1432,7 +1432,7 @@
<property name="margin-right">8</property> <property name="margin-right">8</property>
<property name="margin-start">8</property> <property name="margin-start">8</property>
<property name="margin-end">8</property> <property name="margin-end">8</property>
<property name="text" translatable="no">23</property> <property name="text">23</property>
<property name="orientation">vertical</property> <property name="orientation">vertical</property>
<property name="adjustment">adjustment_hours5</property> <property name="adjustment">adjustment_hours5</property>
<property name="value">23</property> <property name="value">23</property>
@@ -1452,7 +1452,7 @@
<property name="margin-right">8</property> <property name="margin-right">8</property>
<property name="margin-start">8</property> <property name="margin-start">8</property>
<property name="margin-end">8</property> <property name="margin-end">8</property>
<property name="label" translatable="no">:</property> <property name="label">:</property>
<attributes> <attributes>
<attribute name="size" value="20480"/> <attribute name="size" value="20480"/>
</attributes> </attributes>
@@ -1467,7 +1467,7 @@
<object class="GtkSpinButton" id="spb_period_5_minute"> <object class="GtkSpinButton" id="spb_period_5_minute">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">True</property> <property name="can-focus">True</property>
<property name="text" translatable="no">59</property> <property name="text">59</property>
<property name="orientation">vertical</property> <property name="orientation">vertical</property>
<property name="adjustment">adjustment_minutes5</property> <property name="adjustment">adjustment_minutes5</property>
<property name="value">59</property> <property name="value">59</property>
@@ -1483,7 +1483,7 @@
<object class="GtkLabel"> <object class="GtkLabel">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="label" translatable="no">-</property> <property name="label">-</property>
<attributes> <attributes>
<attribute name="size" value="20480"/> <attribute name="size" value="20480"/>
</attributes> </attributes>
@@ -1502,7 +1502,7 @@
<property name="margin-right">8</property> <property name="margin-right">8</property>
<property name="margin-start">8</property> <property name="margin-start">8</property>
<property name="margin-end">8</property> <property name="margin-end">8</property>
<property name="label" translatable="no">00:00</property> <property name="label">00:00</property>
<attributes> <attributes>
<attribute name="size" value="20480"/> <attribute name="size" value="20480"/>
</attributes> </attributes>
@@ -1529,7 +1529,7 @@
<property name="can-focus">True</property> <property name="can-focus">True</property>
<property name="margin-start">8</property> <property name="margin-start">8</property>
<property name="margin-end">8</property> <property name="margin-end">8</property>
<property name="text" translatable="no">23</property> <property name="text">23</property>
<property name="orientation">vertical</property> <property name="orientation">vertical</property>
<property name="adjustment">adjustment_hours6</property> <property name="adjustment">adjustment_hours6</property>
<property name="value">23</property> <property name="value">23</property>
@@ -1549,7 +1549,7 @@
<property name="margin-right">8</property> <property name="margin-right">8</property>
<property name="margin-start">8</property> <property name="margin-start">8</property>
<property name="margin-end">8</property> <property name="margin-end">8</property>
<property name="label" translatable="no">:</property> <property name="label">:</property>
<attributes> <attributes>
<attribute name="size" value="20480"/> <attribute name="size" value="20480"/>
</attributes> </attributes>
@@ -1564,7 +1564,7 @@
<object class="GtkSpinButton" id="spb_period_6_minute"> <object class="GtkSpinButton" id="spb_period_6_minute">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">True</property> <property name="can-focus">True</property>
<property name="text" translatable="no">59</property> <property name="text">59</property>
<property name="orientation">vertical</property> <property name="orientation">vertical</property>
<property name="adjustment">adjustment_minutes6</property> <property name="adjustment">adjustment_minutes6</property>
<property name="value">59</property> <property name="value">59</property>
@@ -1580,7 +1580,7 @@
<object class="GtkLabel"> <object class="GtkLabel">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="label" translatable="no">-</property> <property name="label">-</property>
<attributes> <attributes>
<attribute name="size" value="20480"/> <attribute name="size" value="20480"/>
</attributes> </attributes>
@@ -1599,7 +1599,7 @@
<property name="margin-right">8</property> <property name="margin-right">8</property>
<property name="margin-start">8</property> <property name="margin-start">8</property>
<property name="margin-end">8</property> <property name="margin-end">8</property>
<property name="label" translatable="no">00:00</property> <property name="label">00:00</property>
<attributes> <attributes>
<attribute name="size" value="20480"/> <attribute name="size" value="20480"/>
</attributes> </attributes>
@@ -1626,7 +1626,7 @@
<property name="can-focus">True</property> <property name="can-focus">True</property>
<property name="margin-start">8</property> <property name="margin-start">8</property>
<property name="margin-end">8</property> <property name="margin-end">8</property>
<property name="text" translatable="no">23</property> <property name="text">23</property>
<property name="orientation">vertical</property> <property name="orientation">vertical</property>
<property name="adjustment">adjustment_hours7</property> <property name="adjustment">adjustment_hours7</property>
<property name="value">23</property> <property name="value">23</property>
@@ -1646,7 +1646,7 @@
<property name="margin-right">8</property> <property name="margin-right">8</property>
<property name="margin-start">8</property> <property name="margin-start">8</property>
<property name="margin-end">8</property> <property name="margin-end">8</property>
<property name="label" translatable="no">:</property> <property name="label">:</property>
<attributes> <attributes>
<attribute name="size" value="20480"/> <attribute name="size" value="20480"/>
</attributes> </attributes>
@@ -1661,7 +1661,7 @@
<object class="GtkSpinButton" id="spb_period_7_minute"> <object class="GtkSpinButton" id="spb_period_7_minute">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">True</property> <property name="can-focus">True</property>
<property name="text" translatable="no">59</property> <property name="text">59</property>
<property name="orientation">vertical</property> <property name="orientation">vertical</property>
<property name="adjustment">adjustment_minutes7</property> <property name="adjustment">adjustment_minutes7</property>
<property name="value">59</property> <property name="value">59</property>
@@ -1677,7 +1677,7 @@
<object class="GtkLabel"> <object class="GtkLabel">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="label" translatable="no">-</property> <property name="label">-</property>
<attributes> <attributes>
<attribute name="size" value="20480"/> <attribute name="size" value="20480"/>
</attributes> </attributes>
@@ -1696,7 +1696,7 @@
<property name="margin-right">8</property> <property name="margin-right">8</property>
<property name="margin-start">8</property> <property name="margin-start">8</property>
<property name="margin-end">8</property> <property name="margin-end">8</property>
<property name="label" translatable="no">00:00</property> <property name="label">00:00</property>
<attributes> <attributes>
<attribute name="size" value="20480"/> <attribute name="size" value="20480"/>
</attributes> </attributes>
@@ -1721,7 +1721,7 @@
<object class="GtkSpinButton" id="spb_period_8_hour"> <object class="GtkSpinButton" id="spb_period_8_hour">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">True</property> <property name="can-focus">True</property>
<property name="text" translatable="no">23</property> <property name="text">23</property>
<property name="orientation">vertical</property> <property name="orientation">vertical</property>
<property name="adjustment">adjustment_hours8</property> <property name="adjustment">adjustment_hours8</property>
<property name="value">23</property> <property name="value">23</property>
@@ -1741,7 +1741,7 @@
<property name="margin-right">8</property> <property name="margin-right">8</property>
<property name="margin-start">8</property> <property name="margin-start">8</property>
<property name="margin-end">8</property> <property name="margin-end">8</property>
<property name="label" translatable="no">:</property> <property name="label">:</property>
<attributes> <attributes>
<attribute name="size" value="20480"/> <attribute name="size" value="20480"/>
</attributes> </attributes>
@@ -1756,7 +1756,7 @@
<object class="GtkSpinButton" id="spb_period_8_minute"> <object class="GtkSpinButton" id="spb_period_8_minute">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">True</property> <property name="can-focus">True</property>
<property name="text" translatable="no">59</property> <property name="text">59</property>
<property name="orientation">vertical</property> <property name="orientation">vertical</property>
<property name="adjustment">adjustment_minutes8</property> <property name="adjustment">adjustment_minutes8</property>
<property name="value">59</property> <property name="value">59</property>
@@ -1772,7 +1772,7 @@
<object class="GtkLabel"> <object class="GtkLabel">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="label" translatable="no">-</property> <property name="label">-</property>
<attributes> <attributes>
<attribute name="size" value="20480"/> <attribute name="size" value="20480"/>
</attributes> </attributes>
@@ -1791,7 +1791,7 @@
<property name="margin-right">8</property> <property name="margin-right">8</property>
<property name="margin-start">8</property> <property name="margin-start">8</property>
<property name="margin-end">8</property> <property name="margin-end">8</property>
<property name="label" translatable="no">00:00</property> <property name="label">00:00</property>
<attributes> <attributes>
<attribute name="size" value="20480"/> <attribute name="size" value="20480"/>
</attributes> </attributes>
@@ -1820,7 +1820,7 @@
<property name="margin-right">8</property> <property name="margin-right">8</property>
<property name="margin-start">8</property> <property name="margin-start">8</property>
<property name="margin-end">8</property> <property name="margin-end">8</property>
<property name="text" translatable="no">23</property> <property name="text">23</property>
<property name="orientation">vertical</property> <property name="orientation">vertical</property>
<property name="adjustment">adjustment_hours9</property> <property name="adjustment">adjustment_hours9</property>
<property name="value">23</property> <property name="value">23</property>
@@ -1840,7 +1840,7 @@
<property name="margin-right">8</property> <property name="margin-right">8</property>
<property name="margin-start">8</property> <property name="margin-start">8</property>
<property name="margin-end">8</property> <property name="margin-end">8</property>
<property name="label" translatable="no">:</property> <property name="label">:</property>
<attributes> <attributes>
<attribute name="size" value="20480"/> <attribute name="size" value="20480"/>
</attributes> </attributes>
@@ -1855,7 +1855,7 @@
<object class="GtkSpinButton" id="spb_period_9_minute"> <object class="GtkSpinButton" id="spb_period_9_minute">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">True</property> <property name="can-focus">True</property>
<property name="text" translatable="no">57</property> <property name="text">57</property>
<property name="orientation">vertical</property> <property name="orientation">vertical</property>
<property name="adjustment">adjustment_minutes9</property> <property name="adjustment">adjustment_minutes9</property>
<property name="value">57</property> <property name="value">57</property>
@@ -1871,7 +1871,7 @@
<object class="GtkLabel"> <object class="GtkLabel">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="label" translatable="no">-</property> <property name="label">-</property>
<attributes> <attributes>
<attribute name="size" value="20480"/> <attribute name="size" value="20480"/>
</attributes> </attributes>
@@ -1890,7 +1890,7 @@
<property name="margin-right">8</property> <property name="margin-right">8</property>
<property name="margin-start">8</property> <property name="margin-start">8</property>
<property name="margin-end">8</property> <property name="margin-end">8</property>
<property name="label" translatable="no">23:59</property> <property name="label">23:59</property>
<attributes> <attributes>
<attribute name="size" value="20480"/> <attribute name="size" value="20480"/>
</attributes> </attributes>
@@ -1989,7 +1989,7 @@
<property name="margin-right">8</property> <property name="margin-right">8</property>
<property name="margin-start">8</property> <property name="margin-start">8</property>
<property name="margin-end">8</property> <property name="margin-end">8</property>
<property name="label" translatable="no">00:00</property> <property name="label">00:00</property>
<attributes> <attributes>
<attribute name="size" value="20480"/> <attribute name="size" value="20480"/>
</attributes> </attributes>
@@ -2004,7 +2004,7 @@
<object class="GtkLabel"> <object class="GtkLabel">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="label" translatable="no">-</property> <property name="label">-</property>
<attributes> <attributes>
<attribute name="size" value="20480"/> <attribute name="size" value="20480"/>
</attributes> </attributes>
@@ -2023,7 +2023,7 @@
<property name="margin-right">8</property> <property name="margin-right">8</property>
<property name="margin-start">8</property> <property name="margin-start">8</property>
<property name="margin-end">8</property> <property name="margin-end">8</property>
<property name="label" translatable="no">00:00</property> <property name="label">00:00</property>
<attributes> <attributes>
<attribute name="size" value="20480"/> <attribute name="size" value="20480"/>
</attributes> </attributes>
@@ -2052,7 +2052,7 @@
<property name="margin-right">8</property> <property name="margin-right">8</property>
<property name="margin-start">8</property> <property name="margin-start">8</property>
<property name="margin-end">8</property> <property name="margin-end">8</property>
<property name="text" translatable="no">23</property> <property name="text">23</property>
<property name="orientation">vertical</property> <property name="orientation">vertical</property>
<property name="adjustment">adjustment_hours2</property> <property name="adjustment">adjustment_hours2</property>
<property name="value">23</property> <property name="value">23</property>
@@ -2072,7 +2072,7 @@
<property name="margin-right">8</property> <property name="margin-right">8</property>
<property name="margin-start">8</property> <property name="margin-start">8</property>
<property name="margin-end">8</property> <property name="margin-end">8</property>
<property name="label" translatable="no">:</property> <property name="label">:</property>
<attributes> <attributes>
<attribute name="size" value="20480"/> <attribute name="size" value="20480"/>
</attributes> </attributes>
@@ -2087,7 +2087,7 @@
<object class="GtkSpinButton" id="spb_period_2_minute"> <object class="GtkSpinButton" id="spb_period_2_minute">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">True</property> <property name="can-focus">True</property>
<property name="text" translatable="no">59</property> <property name="text">59</property>
<property name="orientation">vertical</property> <property name="orientation">vertical</property>
<property name="adjustment">adjustment_minutes2</property> <property name="adjustment">adjustment_minutes2</property>
<property name="value">59</property> <property name="value">59</property>
@@ -2103,7 +2103,7 @@
<object class="GtkLabel"> <object class="GtkLabel">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="label" translatable="no">-</property> <property name="label">-</property>
<attributes> <attributes>
<attribute name="size" value="20480"/> <attribute name="size" value="20480"/>
</attributes> </attributes>
@@ -2122,7 +2122,7 @@
<property name="margin-right">8</property> <property name="margin-right">8</property>
<property name="margin-start">8</property> <property name="margin-start">8</property>
<property name="margin-end">8</property> <property name="margin-end">8</property>
<property name="label" translatable="no">00:00</property> <property name="label">00:00</property>
<attributes> <attributes>
<attribute name="size" value="20480"/> <attribute name="size" value="20480"/>
</attributes> </attributes>
@@ -2151,7 +2151,7 @@
<property name="margin-right">8</property> <property name="margin-right">8</property>
<property name="margin-start">8</property> <property name="margin-start">8</property>
<property name="margin-end">8</property> <property name="margin-end">8</property>
<property name="text" translatable="no">23</property> <property name="text">23</property>
<property name="orientation">vertical</property> <property name="orientation">vertical</property>
<property name="adjustment">adjustment_hours3</property> <property name="adjustment">adjustment_hours3</property>
<property name="value">23</property> <property name="value">23</property>
@@ -2171,7 +2171,7 @@
<property name="margin-right">8</property> <property name="margin-right">8</property>
<property name="margin-start">8</property> <property name="margin-start">8</property>
<property name="margin-end">8</property> <property name="margin-end">8</property>
<property name="label" translatable="no">:</property> <property name="label">:</property>
<attributes> <attributes>
<attribute name="size" value="20480"/> <attribute name="size" value="20480"/>
</attributes> </attributes>
@@ -2186,7 +2186,7 @@
<object class="GtkSpinButton" id="spb_period_3_minute"> <object class="GtkSpinButton" id="spb_period_3_minute">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">True</property> <property name="can-focus">True</property>
<property name="text" translatable="no">59</property> <property name="text">59</property>
<property name="orientation">vertical</property> <property name="orientation">vertical</property>
<property name="adjustment">adjustment_minutes3</property> <property name="adjustment">adjustment_minutes3</property>
<property name="value">59</property> <property name="value">59</property>
@@ -2202,7 +2202,7 @@
<object class="GtkLabel"> <object class="GtkLabel">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="label" translatable="no">-</property> <property name="label">-</property>
<attributes> <attributes>
<attribute name="size" value="20480"/> <attribute name="size" value="20480"/>
</attributes> </attributes>
@@ -2221,7 +2221,7 @@
<property name="margin-right">8</property> <property name="margin-right">8</property>
<property name="margin-start">8</property> <property name="margin-start">8</property>
<property name="margin-end">8</property> <property name="margin-end">8</property>
<property name="label" translatable="no">00:00</property> <property name="label">00:00</property>
<attributes> <attributes>
<attribute name="size" value="20480"/> <attribute name="size" value="20480"/>
</attributes> </attributes>
@@ -2250,7 +2250,7 @@
<property name="margin-right">8</property> <property name="margin-right">8</property>
<property name="margin-start">8</property> <property name="margin-start">8</property>
<property name="margin-end">8</property> <property name="margin-end">8</property>
<property name="text" translatable="no">23</property> <property name="text">23</property>
<property name="orientation">vertical</property> <property name="orientation">vertical</property>
<property name="adjustment">adjustment_hours4</property> <property name="adjustment">adjustment_hours4</property>
<property name="value">23</property> <property name="value">23</property>
@@ -2270,7 +2270,7 @@
<property name="margin-right">8</property> <property name="margin-right">8</property>
<property name="margin-start">8</property> <property name="margin-start">8</property>
<property name="margin-end">8</property> <property name="margin-end">8</property>
<property name="label" translatable="no">:</property> <property name="label">:</property>
<attributes> <attributes>
<attribute name="size" value="20480"/> <attribute name="size" value="20480"/>
</attributes> </attributes>
@@ -2285,7 +2285,7 @@
<object class="GtkSpinButton" id="spb_period_4_minute"> <object class="GtkSpinButton" id="spb_period_4_minute">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">True</property> <property name="can-focus">True</property>
<property name="text" translatable="no">59</property> <property name="text">59</property>
<property name="orientation">vertical</property> <property name="orientation">vertical</property>
<property name="adjustment">adjustment_minutes4</property> <property name="adjustment">adjustment_minutes4</property>
<property name="value">59</property> <property name="value">59</property>
@@ -2301,7 +2301,7 @@
<object class="GtkLabel"> <object class="GtkLabel">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="label" translatable="no">-</property> <property name="label">-</property>
<attributes> <attributes>
<attribute name="size" value="20480"/> <attribute name="size" value="20480"/>
</attributes> </attributes>
@@ -2320,7 +2320,7 @@
<property name="margin-right">8</property> <property name="margin-right">8</property>
<property name="margin-start">8</property> <property name="margin-start">8</property>
<property name="margin-end">8</property> <property name="margin-end">8</property>
<property name="label" translatable="no">00:00</property> <property name="label">00:00</property>
<attributes> <attributes>
<attribute name="size" value="20480"/> <attribute name="size" value="20480"/>
</attributes> </attributes>
@@ -2345,7 +2345,7 @@
<object class="GtkSpinButton" id="spb_period_1_hour"> <object class="GtkSpinButton" id="spb_period_1_hour">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">True</property> <property name="can-focus">True</property>
<property name="text" translatable="no">23</property> <property name="text">23</property>
<property name="orientation">vertical</property> <property name="orientation">vertical</property>
<property name="adjustment">adjustment_hours1</property> <property name="adjustment">adjustment_hours1</property>
<property name="value">23</property> <property name="value">23</property>
@@ -2365,7 +2365,7 @@
<property name="margin-right">8</property> <property name="margin-right">8</property>
<property name="margin-start">8</property> <property name="margin-start">8</property>
<property name="margin-end">8</property> <property name="margin-end">8</property>
<property name="label" translatable="no">:</property> <property name="label">:</property>
<attributes> <attributes>
<attribute name="size" value="20480"/> <attribute name="size" value="20480"/>
</attributes> </attributes>
@@ -2380,7 +2380,7 @@
<object class="GtkSpinButton" id="spb_period_1_minute"> <object class="GtkSpinButton" id="spb_period_1_minute">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">True</property> <property name="can-focus">True</property>
<property name="text" translatable="no">59</property> <property name="text">59</property>
<property name="orientation">vertical</property> <property name="orientation">vertical</property>
<property name="adjustment">adjustment_minutes1</property> <property name="adjustment">adjustment_minutes1</property>
<property name="value">59</property> <property name="value">59</property>
@@ -2396,7 +2396,7 @@
<object class="GtkLabel"> <object class="GtkLabel">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="label" translatable="no">-</property> <property name="label">-</property>
<attributes> <attributes>
<attribute name="size" value="20480"/> <attribute name="size" value="20480"/>
</attributes> </attributes>
@@ -2415,7 +2415,7 @@
<property name="margin-right">8</property> <property name="margin-right">8</property>
<property name="margin-start">8</property> <property name="margin-start">8</property>
<property name="margin-end">8</property> <property name="margin-end">8</property>
<property name="label" translatable="no">00:00</property> <property name="label">00:00</property>
<attributes> <attributes>
<attribute name="size" value="20480"/> <attribute name="size" value="20480"/>
</attributes> </attributes>
@@ -2553,7 +2553,7 @@
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="halign">start</property> <property name="halign">start</property>
<property name="label" translatable="yes">Dynamic Background color</property> <property name="label" translatable="yes">Login Screen</property>
<attributes> <attributes>
<attribute name="weight" value="bold"/> <attribute name="weight" value="bold"/>
</attributes> </attributes>
@@ -2564,6 +2564,80 @@
<property name="position">2</property> <property name="position">2</property>
</packing> </packing>
</child> </child>
<child>
<object class="GtkListBox">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="selection-mode">none</property>
<property name="activate-on-single-click">False</property>
<child>
<object class="GtkListBoxRow">
<property name="visible">True</property>
<property name="can-focus">True</property>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="margin-left">12</property>
<property name="margin-right">12</property>
<property name="margin-start">12</property>
<property name="margin-end">12</property>
<property name="margin-top">12</property>
<property name="margin-bottom">12</property>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="halign">start</property>
<property name="hexpand">True</property>
<property name="label" translatable="yes">Set the background image as Login Screen background</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkSwitch" id="sw_login_image">
<property name="visible">True</property>
<property name="can-focus">True</property>
<signal name="state-set" handler="on_sw_login_image_state_set" swapped="no"/>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="padding">3</property>
<property name="position">3</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="halign">start</property>
<property name="label" translatable="yes">Dynamic Background color</property>
<attributes>
<attribute name="weight" value="bold"/>
</attributes>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">4</property>
</packing>
</child>
<child> <child>
<object class="GtkListBox"> <object class="GtkListBox">
<property name="visible">True</property> <property name="visible">True</property>
@@ -2602,6 +2676,7 @@
<object class="GtkSwitch" id="sw_dynamic_background_color"> <object class="GtkSwitch" id="sw_dynamic_background_color">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">True</property> <property name="can-focus">True</property>
<signal name="state-set" handler="on_sw_dynamic_background_color_state_set" swapped="no"/>
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
@@ -2618,7 +2693,7 @@
<property name="expand">False</property> <property name="expand">False</property>
<property name="fill">True</property> <property name="fill">True</property>
<property name="padding">3</property> <property name="padding">3</property>
<property name="position">3</property> <property name="position">5</property>
</packing> </packing>
</child> </child>
<child> <child>
@@ -2630,7 +2705,7 @@
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
<property name="fill">True</property> <property name="fill">True</property>
<property name="position">4</property> <property name="position">6</property>
</packing> </packing>
</child> </child>
</object> </object>

View File

@@ -130,5 +130,9 @@
"period_9_custom_start_time": { "period_9_custom_start_time": {
"type": "generic", "type": "generic",
"default": "21:00" "default": "21:00"
},
"login_image": {
"type": "generic",
"default": true
} }
} }

View File

@@ -2,7 +2,7 @@
from gi.repository import Gio, Gdk from gi.repository import Gio, Gdk
# Packages # Packages
import os, time, gi, locale import os, time, locale, subprocess, sys
from PIL import Image from PIL import Image
# Local scripts # Local scripts
@@ -183,9 +183,20 @@ class Main_View_Model:
self.current_image_uri = self.cinnamon_prefs.source_folder + self.cinnamon_prefs.period_images[i] self.current_image_uri = self.cinnamon_prefs.source_folder + self.cinnamon_prefs.period_images[i]
break break
# Set the background # Update the background
self.background_settings['picture-uri'] = "file://" + self.current_image_uri self.background_settings['picture-uri'] = "file://" + self.current_image_uri
# Update the login_image
if self.cinnamon_prefs.login_image:
# Create the folder in /tmp
try:
os.mkdir("/tmp/cinnamon_dynamic_wallpaper")
except:
print("Folder already exists")
# Copy the current image to the temp folder for the login screen
os.system("cp " + self.current_image_uri + " " + "/tmp/cinnamon_dynamic_wallpaper/login_image.jpg")
# Set background stretching # Set background stretching
self.background_settings['picture-options'] = self.cinnamon_prefs.picture_aspect self.background_settings['picture-options'] = self.cinnamon_prefs.picture_aspect
@@ -269,3 +280,52 @@ class Main_View_Model:
except: except:
self.background_settings['primary-color'] = "#000000" self.background_settings['primary-color'] = "#000000"
self.background_settings['secondary-color'] = "#000000" self.background_settings['secondary-color'] = "#000000"
def set_login_image(self):
""" Writes a path to file in /tmp/cinnamon_dynamic_wallpaper to display the wallpaper on the login screen
"""
# New config file content
file_content = ""
# Location of the config file
file_location = self.WORKING_DIR + "/slick-greeter.conf"
if os.path.isfile("/etc/lightdm/slick-greeter.conf"):
# File already exists, make a copy of the config
with open("/etc/lightdm/slick-greeter.conf", "r") as conf_file:
for line in conf_file.readlines():
if line.startswith("background"):
# Case 1: Preference is already set as expected -> leave function
print(line)
if line.find("cinnamon_dynamic_wallpaper/login_image.jpg") != -1 and self.cinnamon_prefs.login_image or \
line.find("cinnamon_dynamic_wallpaper/login_image.jpg") == -1 and not self.cinnamon_prefs.login_image:
return
# Case 2: Function enabled -> Set the path to the login image
elif self.cinnamon_prefs.login_image:
file_content += "background=/tmp/cinnamon_dynamic_wallpaper/login_image.jpg\n"
# Case 3: Function disabled -> Remove the custom login image
elif not self.cinnamon_prefs.login_image:
break
# Other config lines will be simply copied
else:
file_content += line
else:
# File doesn't exists
file_content = "[Greeter]\n"
file_content += "background=/tmp/cinnamon_dynamic_wallpaper/login_image.jpg"
# Create the file
with open(file_location, "w") as conf_file:
conf_file.write(file_content)
conf_file.close()
# Move it to /etc/lightdm
if os.path.isfile("/etc/lightdm/slick-greeter.conf"):
subprocess.call(['pkexec', 'rm', '/etc/lightdm/slick-greeter.conf', 'mv', file_location, '/etc/lightdm/'])
else:
subprocess.call(['pkexec', 'mv', file_location, '/etc/lightdm/'])

View File

@@ -73,6 +73,8 @@ class Cinnamon_Pref_Handler:
self.extract_json('period_9_custom_start_time') self.extract_json('period_9_custom_start_time')
] ]
self.login_image = self.extract_json('login_image')
def value_to_json(self, parameter: str, value: str): def value_to_json(self, parameter: str, value: str):
""" Storing safely a value to the dictionary """ Storing safely a value to the dictionary
@@ -127,6 +129,7 @@ class Cinnamon_Pref_Handler:
self.value_to_json('period_7_custom_start_time', self.period_custom_start_time[7]) self.value_to_json('period_7_custom_start_time', self.period_custom_start_time[7])
self.value_to_json('period_8_custom_start_time', self.period_custom_start_time[8]) self.value_to_json('period_8_custom_start_time', self.period_custom_start_time[8])
self.value_to_json('period_9_custom_start_time', self.period_custom_start_time[9]) self.value_to_json('period_9_custom_start_time', self.period_custom_start_time[9])
self.value_to_json('login_image', self.login_image)
# Write to file # Write to file

View File

@@ -150,6 +150,7 @@ class Main_Window:
# Page 3: Behaviour # Page 3: Behaviour
self.cb_picture_aspect: Gtk.ComboBox = self.builder.get_object("cb_picture_aspect") self.cb_picture_aspect: Gtk.ComboBox = self.builder.get_object("cb_picture_aspect")
self.sw_dynamic_background_color: Gtk.Switch = self.builder.get_object("sw_dynamic_background_color") self.sw_dynamic_background_color: Gtk.Switch = self.builder.get_object("sw_dynamic_background_color")
self.sw_login_image: Gtk.Switch = self.builder.get_object("sw_login_image")
def show(self): def show(self):
@@ -178,6 +179,7 @@ class Main_Window:
self.add_items_to_combo_box(self.cb_picture_aspect, self.view_model.picture_aspects) self.add_items_to_combo_box(self.cb_picture_aspect, self.view_model.picture_aspects)
self.set_active_combobox_item(self.cb_picture_aspect, self.view_model.cinnamon_prefs.picture_aspect) self.set_active_combobox_item(self.cb_picture_aspect, self.view_model.cinnamon_prefs.picture_aspect)
self.sw_dynamic_background_color.set_active(self.view_model.cinnamon_prefs.dynamic_background_color) self.sw_dynamic_background_color.set_active(self.view_model.cinnamon_prefs.dynamic_background_color)
self.sw_login_image.set_active(self.view_model.cinnamon_prefs.login_image)
# Show the main window # Show the main window
@@ -693,6 +695,16 @@ class Main_Window:
""" """
self.view_model.cinnamon_prefs.dynamic_background_color = state self.view_model.cinnamon_prefs.dynamic_background_color = state
def on_sw_login_image_state_set(self, _: Gtk.Switch, state: bool):
""" User switches login background image on or off
Args:
_ (Gtk.Switch): Used Switch
state (bool): Current state
"""
self.view_model.cinnamon_prefs.login_image = state
# About # About
@@ -747,6 +759,7 @@ class Main_Window:
# Use the new settings # Use the new settings
self.view_model.refresh_image() self.view_model.refresh_image()
self.view_model.set_background_gradient() self.view_model.set_background_gradient()
self.view_model.set_login_image()
def on_destroy(self, *args): def on_destroy(self, *args):