Working on support for Cinnamon 4.8 and newer
This commit is contained in:
1 parent
5628dfc4b0
commit
34ad4a9589
93 files changed
+24
-15
No files matched your search
@@ -4,3 +4,4 @@ extracted/
|
|||||||
custom_images/
|
custom_images/
|
||||||
*.txt
|
*.txt
|
||||||
selected/
|
selected/
|
||||||
|
__pycache__
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
../5.4/extension.js
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
../5.4/icon.png
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
../5.4/icons/
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
pref_path = "/.cinnamon/configs/cinnamon-dynamic-wallpaper@TobiZog/cinnamon-dynamic-wallpaper@TobiZog.json"
|
||||||
+1
@@ -0,0 +1 @@
|
|||||||
|
../../5.4/image-configurator/image-configurator.glade
|
||||||
+1
@@ -0,0 +1 @@
|
|||||||
|
../../5.4/image-configurator/image-configurator.py
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
../5.4/images/
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
../5.4/scripts/
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
../5.4/settings-schema.json
|
||||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -0,0 +1,6 @@
|
|||||||
|
from enum import Enum
|
||||||
|
|
||||||
|
class Source(Enum):
|
||||||
|
SELECTED = 0 # Load previous selected images
|
||||||
|
EXTRACT = 1 # Use a custom image set from a heic file
|
||||||
|
SET = 2 # Use an included image set
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
pref_path = "/.config/cinnamon/spices/cinnamon-dynamic-wallpaper@TobiZog/cinnamon-dynamic-wallpaper@TobiZog.json"
|
||||||
File renamed without changes.
+6
-15
@@ -1,21 +1,19 @@
|
|||||||
import gi, os, glob, json, shutil, enum, threading, subprocess
|
import gi, os, glob, json, shutil, enum, threading, subprocess
|
||||||
|
from data.routes import pref_path
|
||||||
|
from data.enum import Source
|
||||||
|
|
||||||
gi.require_version("Gtk", "3.0")
|
gi.require_version("Gtk", "3.0")
|
||||||
from gi.repository import Gtk, GdkPixbuf
|
from gi.repository import Gtk, GdkPixbuf
|
||||||
|
|
||||||
PROJECT_DIR = os.path.dirname(os.path.dirname(__file__)) + "/"
|
PROJECT_DIR = os.path.dirname(os.path.dirname(__file__)) + "/"
|
||||||
UI_PATH = PROJECT_DIR + "image-configurator/" + "image-configurator.glade"
|
UI_PATH = PROJECT_DIR + "image-configurator/" + "image-configurator.glade"
|
||||||
|
PREF_PATH = os.path.expanduser("~") + pref_path
|
||||||
|
|
||||||
IMAGE_DIR = PROJECT_DIR + "images/"
|
IMAGE_DIR = PROJECT_DIR + "images/"
|
||||||
IMAGE_EXTRACT_DIR = IMAGE_DIR + "extracted/"
|
IMAGE_EXTRACT_DIR = IMAGE_DIR + "extracted/"
|
||||||
IMAGE_SETS_DIR = IMAGE_DIR + "included_image_sets/"
|
IMAGE_SETS_DIR = IMAGE_DIR + "included_image_sets/"
|
||||||
IMAGE_SELECTED_DIR = IMAGE_DIR + "selected/"
|
IMAGE_SELECTED_DIR = IMAGE_DIR + "selected/"
|
||||||
|
|
||||||
class Source(enum.Enum):
|
|
||||||
SELECTED = 0 # Load previous selected images
|
|
||||||
EXTRACT = 1 # Use a custom image set from a heic file
|
|
||||||
SET = 2 # Use an included image set
|
|
||||||
|
|
||||||
|
|
||||||
class ImageConfigurator:
|
class ImageConfigurator:
|
||||||
def __init__(self) -> None:
|
def __init__(self) -> None:
|
||||||
@@ -113,13 +111,6 @@ class ImageConfigurator:
|
|||||||
version = version.decode()
|
version = version.decode()
|
||||||
version = version[version.find(" "):version.rfind("\n")].strip()
|
version = version[version.find(" "):version.rfind("\n")].strip()
|
||||||
|
|
||||||
if version.startswith("5.4"):
|
|
||||||
self.pref_path = os.path.expanduser("~") + \
|
|
||||||
"/.cinnamon/configs/cinnamon-dynamic-wallpaper@TobiZog/cinnamon-dynamic-wallpaper@TobiZog.json"
|
|
||||||
else:
|
|
||||||
self.pref_path = os.path.expanduser("~") + \
|
|
||||||
"/.config/cinnamon/spices/cinnamon-dynamic-wallpaper@TobiZog/cinnamon-dynamic-wallpaper@TobiZog.json"
|
|
||||||
|
|
||||||
# Load preferences
|
# Load preferences
|
||||||
self.loadFromSettings()
|
self.loadFromSettings()
|
||||||
|
|
||||||
@@ -140,7 +131,7 @@ class ImageConfigurator:
|
|||||||
""" Load preferences from the Cinnamon preference file
|
""" Load preferences from the Cinnamon preference file
|
||||||
"""
|
"""
|
||||||
# Load the settings
|
# Load the settings
|
||||||
with open(self.pref_path, "r") as pref_file:
|
with open(PREF_PATH, "r") as pref_file:
|
||||||
pref_data = json.load(pref_file)
|
pref_data = json.load(pref_file)
|
||||||
|
|
||||||
|
|
||||||
@@ -179,7 +170,7 @@ class ImageConfigurator:
|
|||||||
""" Save preferences to the Cinnamon preference file
|
""" Save preferences to the Cinnamon preference file
|
||||||
"""
|
"""
|
||||||
# Load the settings
|
# Load the settings
|
||||||
with open(self.pref_path, "r") as pref_file:
|
with open(PREF_PATH, "r") as pref_file:
|
||||||
pref_data = json.load(pref_file)
|
pref_data = json.load(pref_file)
|
||||||
|
|
||||||
|
|
||||||
@@ -197,7 +188,7 @@ class ImageConfigurator:
|
|||||||
|
|
||||||
|
|
||||||
# Write the settings
|
# Write the settings
|
||||||
with open(self.pref_path, "w") as pref_file:
|
with open(PREF_PATH, "w") as pref_file:
|
||||||
json.dump(pref_data, pref_file, separators=(',', ':'), indent=4)
|
json.dump(pref_data, pref_file, separators=(',', ':'), indent=4)
|
||||||
|
|
||||||
|
|
||||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -3,6 +3,7 @@
|
|||||||
"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.1",
|
"version": "1.1",
|
||||||
|
"multiversion": true,
|
||||||
"cinnamon-version": [
|
"cinnamon-version": [
|
||||||
"5.4",
|
"5.4",
|
||||||
"5.6",
|
"5.6",
|
||||||
|
|||||||
Reference in new issue
Block a user