From 8cce85a437fa961a11a70f6edd775da2c6021e13 Mon Sep 17 00:00:00 2001 From: Vladyslav Hroshev Date: Mon, 30 Sep 2024 00:14:09 +0300 Subject: [PATCH] GNOME dependable installation, structure and style improvements Split utils in utils.py to a directory Moved ./gnome-shell_css/ to ./gnome-shell/.css/ --- install.py | 7 + scripts/tests.py | 2 + scripts/theme.py | 5 +- scripts/utils.py | 230 ------------------ scripts/utils/__init__.py | 10 + scripts/utils/concatenate_files.py | 12 + scripts/utils/copy_files.py | 12 + scripts/utils/destinaiton_return.py | 11 + scripts/utils/generate_file.py | 37 +++ scripts/utils/get_version_folder.py | 29 +++ scripts/utils/gnome.py | 32 +++ scripts/utils/hex_to_rgba.py | 22 ++ scripts/utils/label_files.py | 44 ++++ scripts/utils/remove_files.py | 48 ++++ scripts/utils/remove_keywords.py | 15 ++ scripts/utils/remove_properties.py | 20 ++ scripts/utils/replace_keywords.py | 19 ++ .../.css}/apps.css | 0 .../.css}/controls.css | 28 +-- .../.css}/datemenu.css | 0 .../.css}/entries.css | 0 .../.css}/keyboard.css | 0 .../.css}/loginlock.css | 0 .../.css}/lookingglass.css | 0 .../.css}/messages.css | 0 .../.css}/osd.css | 58 +---- .../.css}/overview.css | 0 .../.css}/panel.css | 0 .../.css}/popovers.css | 0 .../.css}/quick-settings.css | 4 +- .../.css}/screenshot.css | 0 .../.css}/search.css | 0 .../.versions/..46/.css/buttons.css | 33 +++ .../.versions/..46/.css/toggle.css | 15 ++ .../{ => .versions/..46}/toggle-off.svg | 0 .../{ => .versions/..46}/toggle-off_dnd.svg | 0 .../{ => .versions/..46}/toggle-on.svg | 0 .../{ => .versions/..46}/toggle-on_dnd.svg | 0 .../.versions/47../.css/buttons.css | 7 + .../.versions/47../.css/toggle.css | 19 ++ 40 files changed, 413 insertions(+), 306 deletions(-) delete mode 100644 scripts/utils.py create mode 100644 scripts/utils/__init__.py create mode 100644 scripts/utils/concatenate_files.py create mode 100644 scripts/utils/copy_files.py create mode 100644 scripts/utils/destinaiton_return.py create mode 100644 scripts/utils/generate_file.py create mode 100644 scripts/utils/get_version_folder.py create mode 100644 scripts/utils/gnome.py create mode 100644 scripts/utils/hex_to_rgba.py create mode 100644 scripts/utils/label_files.py create mode 100644 scripts/utils/remove_files.py create mode 100644 scripts/utils/remove_keywords.py create mode 100644 scripts/utils/remove_properties.py create mode 100644 scripts/utils/replace_keywords.py rename theme/{gnome-shell_css => gnome-shell/.css}/apps.css (100%) rename theme/{gnome-shell_css => gnome-shell/.css}/controls.css (82%) rename theme/{gnome-shell_css => gnome-shell/.css}/datemenu.css (100%) rename theme/{gnome-shell_css => gnome-shell/.css}/entries.css (100%) rename theme/{gnome-shell_css => gnome-shell/.css}/keyboard.css (100%) rename theme/{gnome-shell_css => gnome-shell/.css}/loginlock.css (100%) rename theme/{gnome-shell_css => gnome-shell/.css}/lookingglass.css (100%) rename theme/{gnome-shell_css => gnome-shell/.css}/messages.css (100%) rename theme/{gnome-shell_css => gnome-shell/.css}/osd.css (65%) rename theme/{gnome-shell_css => gnome-shell/.css}/overview.css (100%) rename theme/{gnome-shell_css => gnome-shell/.css}/panel.css (100%) rename theme/{gnome-shell_css => gnome-shell/.css}/popovers.css (100%) rename theme/{gnome-shell_css => gnome-shell/.css}/quick-settings.css (98%) rename theme/{gnome-shell_css => gnome-shell/.css}/screenshot.css (100%) rename theme/{gnome-shell_css => gnome-shell/.css}/search.css (100%) create mode 100644 theme/gnome-shell/.versions/..46/.css/buttons.css create mode 100644 theme/gnome-shell/.versions/..46/.css/toggle.css rename theme/gnome-shell/{ => .versions/..46}/toggle-off.svg (100%) rename theme/gnome-shell/{ => .versions/..46}/toggle-off_dnd.svg (100%) rename theme/gnome-shell/{ => .versions/..46}/toggle-on.svg (100%) rename theme/gnome-shell/{ => .versions/..46}/toggle-on_dnd.svg (100%) create mode 100644 theme/gnome-shell/.versions/47../.css/buttons.css create mode 100644 theme/gnome-shell/.versions/47../.css/toggle.css diff --git a/install.py b/install.py index cea9032..ece7a55 100644 --- a/install.py +++ b/install.py @@ -14,6 +14,10 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . +# TODO: output current GNOME version. Warn if it's not supported +# TODO: rework checkboxes for GNOME 47 +# TODO: test on older GNOME versions +# TODO: install theme using only standard colors from settings color picker import json # working with json files import argparse # command-line options @@ -24,6 +28,7 @@ from scripts import config # folder and files definitions from scripts.tweaks_manager import TweaksManager # load tweaks from files from scripts.utils import remove_files # delete already installed Marble theme +from scripts.utils.gnome import apply_gnome_theme # apply theme to GNOME shell from scripts.theme import Theme from scripts.gdm import GlobalTheme @@ -202,6 +207,8 @@ def main(): else: local_theme(args, colors) + apply_gnome_theme() + # TODO: inform user about already applied theme. if not, apply it manually if __name__ == "__main__": diff --git a/scripts/tests.py b/scripts/tests.py index b8ff790..6673060 100644 --- a/scripts/tests.py +++ b/scripts/tests.py @@ -1,3 +1,5 @@ +# TODO: Add more tests + import unittest import os import json diff --git a/scripts/theme.py b/scripts/theme.py index e52298b..b18a8fe 100644 --- a/scripts/theme.py +++ b/scripts/theme.py @@ -33,7 +33,10 @@ class Theme: # move files to temp folder copy_files(self.theme_folder, self.temp_folder) - generate_file(f"{self.theme_folder}_css/", self.main_styles) + generate_file(f"{self.theme_folder}", self.main_styles) + # after generating main styles, remove .css and .versions folders + shutil.rmtree(f"{self.temp_folder}/.css/", ignore_errors=True) + shutil.rmtree(f"{self.temp_folder}/.versions/", ignore_errors=True) # if theme is filled if is_filled: diff --git a/scripts/utils.py b/scripts/utils.py deleted file mode 100644 index c266099..0000000 --- a/scripts/utils.py +++ /dev/null @@ -1,230 +0,0 @@ -import os -from . import config # name of folders and files - - -def generate_file(folder, final_file): - """ - Combines all files in a folder into a single file - :param folder: source folder - :param final_file: location where file will be created - """ - - opened_file = open(final_file, "w") - - for file in os.listdir(folder): - with open(folder + file) as f: - opened_file.write(f.read() + '\n') - - opened_file.close() - - -def concatenate_files(edit_file, file): - """ - Merge two files - :param edit_file: where it will be appended - :param file: file you want to append - """ - - with open(file, 'r') as read_file: - file_content = read_file.read() - - with open(edit_file, 'a') as write_file: - write_file.write('\n' + file_content) - - -def remove_files(): - """ - Delete already installed Marble theme - """ - - paths = (config.themes_folder, "~/.local/share/themes") - - print("💡 You do not need to delete files if you want to update theme.\n") - - confirmation = input(f"Do you want to delete all \"Marble\" folders in {' and in '.join(paths)}? (y/N) ").lower() - - if confirmation == "y": - for path in paths: - - # Check if the path exists - if os.path.exists(os.path.expanduser(path)): - - # Get the list of folders in the path - folders = os.listdir(os.path.expanduser(path)) - - # toggle if folder has no marble theme - found_folder = False - - for folder in folders: - if folder.startswith("Marble"): - folder_path = os.path.join(os.path.expanduser(path), folder) - print(f"Deleting folder {folder_path}...", end='') - - try: - os.system(f"rm -r {folder_path}") - - except Exception as e: - print(f"Error deleting folder {folder_path}: {e}") - - else: - found_folder = True - print("Done.") - - if not found_folder: - print(f"No folders starting with \"Marble\" found in {path}.") - - else: - print(f"The path {path} does not exist.") - - -def destination_return(themes_folder, path_name, theme_mode, theme_type): - """ - Copied/modified theme location - :param themes_folder: themes folder location - :param path_name: color name - :param theme_mode: theme name (light or dark) - :param theme_type: theme type (gnome-shell, gtk-4.0, ...) - :return: copied files' folder location - """ - - return f"{themes_folder}/Marble-{path_name}-{theme_mode}/{theme_type}/" - - -def copy_files(source, destination): - """ - Copy files from the source to another directory - :param source: where files will be copied - :param destination: where files will be pasted - """ - - destination = os.path.expanduser(destination) # expand ~ to /home/user - os.makedirs(destination, exist_ok=True) - os.system(f"cp -aT {source} {destination}") - - -def replace_keywords(file, *args): - """ - Replace file with several keywords - :param file: file name where keywords must be replaced - :param args: (keyword, replacement), (...), ... - """ - - # skip binary files in project - if not file.lower().endswith(('.css', '.scss', '.svg')): - return - - with open(file, "r") as read_file: - content = read_file.read() - - for keyword, replacement in args: - content = content.replace(keyword, replacement) - - with open(file, "w") as write_file: - write_file.write(content) - - -def hex_to_rgba(hex_color): - """ - Convert hex(a) to rgba - :param hex_color: input value - """ - - try: - if len(hex_color) in range(6, 10): - hex_color = hex_color.lstrip('#') + "ff" - # if is convertable - int(hex_color[:], 16) - else: - raise ValueError - - except ValueError: - raise ValueError(f'Error: Invalid HEX color code: {hex_color}') - - else: - return int(hex_color[0:2], 16), \ - int(hex_color[2:4], 16), \ - int(hex_color[4:6], 16), \ - int(hex_color[6:8], 16) / 255 - - -def label_files(directory, label, *args): - """ - Add a label to all files in a directory - :param directory: folder where files are located - :param label: label to add - :param args: files to change links to labeled files - :return: - """ - - # Open all files - files = [open(file, 'r') for file in args] - read_files = [] - - filenames = [] - - for filename in os.listdir(directory): - # Skip if the file is already labeled - if label in filename: - continue - - # Split the filename into name and extension - name, extension = os.path.splitext(filename) - - # Form the new filename and rename the file - new_filename = f"{name}-{label}{extension}" - os.rename(os.path.join(directory, filename), os.path.join(directory, new_filename)) - - filenames.append((filename, new_filename)) - - # Replace the filename in all files - for i, file in enumerate(files): - read_file = file.read() - read_file.replace(filenames[i][0], filenames[i][1]) - read_files.append(read_file) - file.close() - - write_files = [open(file, 'w') for file in args] - - # Write the changes to the files and close them - for i, file in enumerate(write_files): - file.write(read_files[i]) - file.close() - - -def remove_properties(file, *args): - """ - Remove properties from a file - :param file: file name - :param args: properties to remove - """ - - new_content = "" - - with open(file, "r") as read_file: - content = read_file.read() - - for line in content.splitlines(): - if not any(prop in line for prop in args): - new_content += line + "\n" - elif "}" in line: - new_content += "}\n" - - with open(file, "w") as write_file: - write_file.write(new_content) - - -def remove_keywords(file, *args): - """ - Remove keywords from a file - :param file: file name - :param args: keywords to remove - """ - - with open(file, "r") as read_file: - content = read_file.read() - - for arg in args: - content = content.replace(arg, "") - - with open(file, "w") as write_file: - write_file.write(content) diff --git a/scripts/utils/__init__.py b/scripts/utils/__init__.py new file mode 100644 index 0000000..2ae0305 --- /dev/null +++ b/scripts/utils/__init__.py @@ -0,0 +1,10 @@ +from .concatenate_files import concatenate_files +from .copy_files import copy_files +from .destinaiton_return import destination_return +from .generate_file import generate_file +from .hex_to_rgba import hex_to_rgba +from .label_files import label_files +from .remove_files import remove_files +from .remove_keywords import remove_keywords +from .remove_properties import remove_properties +from .replace_keywords import replace_keywords \ No newline at end of file diff --git a/scripts/utils/concatenate_files.py b/scripts/utils/concatenate_files.py new file mode 100644 index 0000000..6ede247 --- /dev/null +++ b/scripts/utils/concatenate_files.py @@ -0,0 +1,12 @@ +def concatenate_files(edit_file, file): + """ + Merge two files + :param edit_file: where it will be appended + :param file: file you want to append + """ + + with open(file, 'r') as read_file: + file_content = read_file.read() + + with open(edit_file, 'a') as write_file: + write_file.write('\n' + file_content) \ No newline at end of file diff --git a/scripts/utils/copy_files.py b/scripts/utils/copy_files.py new file mode 100644 index 0000000..6eb239f --- /dev/null +++ b/scripts/utils/copy_files.py @@ -0,0 +1,12 @@ +import os + +def copy_files(source, destination): + """ + Copy files from the source to another directory + :param source: where files will be copied + :param destination: where files will be pasted + """ + + destination = os.path.expanduser(destination) # expand ~ to /home/user + os.makedirs(destination, exist_ok=True) + os.system(f"cp -aT {source} {destination}") diff --git a/scripts/utils/destinaiton_return.py b/scripts/utils/destinaiton_return.py new file mode 100644 index 0000000..c43cf75 --- /dev/null +++ b/scripts/utils/destinaiton_return.py @@ -0,0 +1,11 @@ +def destination_return(themes_folder, path_name, theme_mode, theme_type): + """ + Copied/modified theme location + :param themes_folder: themes folder location + :param path_name: color name + :param theme_mode: theme name (light or dark) + :param theme_type: theme type (gnome-shell, gtk-4.0, ...) + :return: copied files' folder location + """ + + return f"{themes_folder}/Marble-{path_name}-{theme_mode}/{theme_type}/" diff --git a/scripts/utils/generate_file.py b/scripts/utils/generate_file.py new file mode 100644 index 0000000..c39990e --- /dev/null +++ b/scripts/utils/generate_file.py @@ -0,0 +1,37 @@ +import os +import shutil +from .gnome import gnome_version +from .get_version_folder import get_version_folders + +def generate_file(folder, final_file): + """ + Combines all files in a folder into a single file + :param folder: source folder + :param final_file: location where file will be created + """ + opened_file = open(final_file, "w") + css_folder = f"{folder}/.css/" + + for file in os.listdir(css_folder): + with open(os.path.join(css_folder, file)) as f: + opened_file.write(f.read() + '\n') + + version = gnome_version() + + if version: + base_path = f"{folder}/.versions/" + version_folders = get_version_folders(version, base_path) + + for version_folder in version_folders: + version_path = os.path.join(base_path, version_folder) + css_path = os.path.join(version_path, '.css') + + for css_file in os.listdir(css_path): + with open(os.path.join(css_path, css_file)) as f: + opened_file.write(f.read() + '\n') + + for file in os.listdir(version_path): + if file.endswith('.svg'): + shutil.move(os.path.join(version_path, file), folder) + + opened_file.close() \ No newline at end of file diff --git a/scripts/utils/get_version_folder.py b/scripts/utils/get_version_folder.py new file mode 100644 index 0000000..92848fc --- /dev/null +++ b/scripts/utils/get_version_folder.py @@ -0,0 +1,29 @@ +import os + +def get_version_folders(version, base_path): + """ + Get version folders + :param version: gnome-shell version + :param base_path: base path to version folders + :return: list of matching version folders + """ + version_folders = os.listdir(base_path) + version = int(version.split('.')[0]) # Use only the major version for comparison + matching_folders = [] + + for folder in version_folders: + if '..' in folder: + from_version, to_version = folder.split('..') + if from_version and to_version: + if int(from_version) <= version <= int(to_version): + matching_folders.append(folder) + elif from_version: + if version >= int(from_version): + matching_folders.append(folder) + elif to_version: + if version <= int(to_version): + matching_folders.append(folder) + elif int(folder) == version: + matching_folders.append(folder) + + return matching_folders \ No newline at end of file diff --git a/scripts/utils/gnome.py b/scripts/utils/gnome.py new file mode 100644 index 0000000..6359f50 --- /dev/null +++ b/scripts/utils/gnome.py @@ -0,0 +1,32 @@ +import subprocess + +def gnome_version(): + """ + Get gnome-shell version + """ + + try: + output = subprocess.check_output(['gnome-shell', '--version'], text=True).strip() + return output.split(' ')[2] + except subprocess.CalledProcessError: + return None + +def apply_gnome_theme(theme=None): + """ + Apply gnome-shell theme + :param theme: theme name + """ + + try: + if theme is None: + current_theme = subprocess.check_output(['dconf', 'read', '/org/gnome/shell/extensions/user-theme/name'], text=True).strip().strip("'") + if current_theme.startswith("Marble"): + theme = current_theme + else: + return False + + subprocess.run(['dconf', 'reset', '/org/gnome/shell/extensions/user-theme/name'], check=True) + subprocess.run(['dconf', 'write', '/org/gnome/shell/extensions/user-theme/name', f"'{theme}'"], check=True) + except subprocess.CalledProcessError: + return False + return True \ No newline at end of file diff --git a/scripts/utils/hex_to_rgba.py b/scripts/utils/hex_to_rgba.py new file mode 100644 index 0000000..eff3daf --- /dev/null +++ b/scripts/utils/hex_to_rgba.py @@ -0,0 +1,22 @@ +def hex_to_rgba(hex_color): + """ + Convert hex(a) to rgba + :param hex_color: input value + """ + + try: + if len(hex_color) in range(6, 10): + hex_color = hex_color.lstrip('#') + "ff" + # if is convertable + int(hex_color[:], 16) + else: + raise ValueError + + except ValueError: + raise ValueError(f'Error: Invalid HEX color code: {hex_color}') + + else: + return int(hex_color[0:2], 16), \ + int(hex_color[2:4], 16), \ + int(hex_color[4:6], 16), \ + int(hex_color[6:8], 16) / 255 \ No newline at end of file diff --git a/scripts/utils/label_files.py b/scripts/utils/label_files.py new file mode 100644 index 0000000..801b4d5 --- /dev/null +++ b/scripts/utils/label_files.py @@ -0,0 +1,44 @@ +import os + +def label_files(directory, label, *args): + """ + Add a label to all files in a directory + :param directory: folder where files are located + :param label: label to add + :param args: files to change links to labeled files + :return: + """ + + # Open all files + files = [open(file, 'r') for file in args] + read_files = [] + + filenames = [] + + for filename in os.listdir(directory): + # Skip if the file is already labeled + if label in filename: + continue + + # Split the filename into name and extension + name, extension = os.path.splitext(filename) + + # Form the new filename and rename the file + new_filename = f"{name}-{label}{extension}" + os.rename(os.path.join(directory, filename), os.path.join(directory, new_filename)) + + filenames.append((filename, new_filename)) + + # Replace the filename in all files + for i, file in enumerate(files): + read_file = file.read() + read_file.replace(filenames[i][0], filenames[i][1]) + read_files.append(read_file) + file.close() + + write_files = [open(file, 'w') for file in args] + + # Write the changes to the files and close them + for i, file in enumerate(write_files): + file.write(read_files[i]) + file.close() diff --git a/scripts/utils/remove_files.py b/scripts/utils/remove_files.py new file mode 100644 index 0000000..d32cbd3 --- /dev/null +++ b/scripts/utils/remove_files.py @@ -0,0 +1,48 @@ +# TODO: Less verbose output for the user and simplify the code + +from .. import config +import os + +def remove_files(): + """ + Delete already installed Marble theme + """ + + paths = (config.themes_folder, "~/.local/share/themes") + + print("💡 You do not need to delete files if you want to update theme.\n") + + confirmation = input(f"Do you want to delete all \"Marble\" folders in {' and in '.join(paths)}? (y/N) ").lower() + + if confirmation == "y": + for path in paths: + + # Check if the path exists + if os.path.exists(os.path.expanduser(path)): + + # Get the list of folders in the path + folders = os.listdir(os.path.expanduser(path)) + + # toggle if folder has no marble theme + found_folder = False + + for folder in folders: + if folder.startswith("Marble"): + folder_path = os.path.join(os.path.expanduser(path), folder) + print(f"Deleting folder {folder_path}...", end='') + + try: + os.system(f"rm -r {folder_path}") + + except Exception as e: + print(f"Error deleting folder {folder_path}: {e}") + + else: + found_folder = True + print("Done.") + + if not found_folder: + print(f"No folders starting with \"Marble\" found in {path}.") + + else: + print(f"The path {path} does not exist.") \ No newline at end of file diff --git a/scripts/utils/remove_keywords.py b/scripts/utils/remove_keywords.py new file mode 100644 index 0000000..61713dc --- /dev/null +++ b/scripts/utils/remove_keywords.py @@ -0,0 +1,15 @@ +def remove_keywords(file, *args): + """ + Remove keywords from a file + :param file: file name + :param args: keywords to remove + """ + + with open(file, "r") as read_file: + content = read_file.read() + + for arg in args: + content = content.replace(arg, "") + + with open(file, "w") as write_file: + write_file.write(content) diff --git a/scripts/utils/remove_properties.py b/scripts/utils/remove_properties.py new file mode 100644 index 0000000..eed79ce --- /dev/null +++ b/scripts/utils/remove_properties.py @@ -0,0 +1,20 @@ +def remove_properties(file, *args): + """ + Remove properties from a file + :param file: file name + :param args: properties to remove + """ + + new_content = "" + + with open(file, "r") as read_file: + content = read_file.read() + + for line in content.splitlines(): + if not any(prop in line for prop in args): + new_content += line + "\n" + elif "}" in line: + new_content += "}\n" + + with open(file, "w") as write_file: + write_file.write(new_content) \ No newline at end of file diff --git a/scripts/utils/replace_keywords.py b/scripts/utils/replace_keywords.py new file mode 100644 index 0000000..b90445e --- /dev/null +++ b/scripts/utils/replace_keywords.py @@ -0,0 +1,19 @@ +def replace_keywords(file, *args): + """ + Replace file with several keywords + :param file: file name where keywords must be replaced + :param args: (keyword, replacement), (...), ... + """ + + # skip binary files in project + if not file.lower().endswith(('.css', '.scss', '.svg')): + return + + with open(file, "r") as read_file: + content = read_file.read() + + for keyword, replacement in args: + content = content.replace(keyword, replacement) + + with open(file, "w") as write_file: + write_file.write(content) diff --git a/theme/gnome-shell_css/apps.css b/theme/gnome-shell/.css/apps.css similarity index 100% rename from theme/gnome-shell_css/apps.css rename to theme/gnome-shell/.css/apps.css diff --git a/theme/gnome-shell_css/controls.css b/theme/gnome-shell/.css/controls.css similarity index 82% rename from theme/gnome-shell_css/controls.css rename to theme/gnome-shell/.css/controls.css index f6108a5..74ca9a5 100644 --- a/theme/gnome-shell_css/controls.css +++ b/theme/gnome-shell/.css/controls.css @@ -25,8 +25,9 @@ /* Toggles */ +/* .toggle-switch handle styled in ..46, 47.. */ + .toggle-switch { - /* background-image: url("./toggle-off.svg"); */ /* size same as svg */ height: 18px; width: 33px; @@ -36,23 +37,9 @@ } .toggle-switch:checked { - /* background-image: url("./toggle-on.svg"); */ background-color: BUTTON-COLOR; } -.toggle-switch .handle { - /* toggle-switch height - handle margin * 2 */ - width: 14px; - height: 14px; - margin: 2px; - background-color: TEXT-SECONDARY-COLOR; -} - -.toggle-switch:checked .handle { - background-color: BUTTON-TEXT-COLOR; -} - - /* Do Not Distrub toggle */ .dnd-button { @@ -64,26 +51,15 @@ width: 40px; height: 22px; border-radius: 9px; - /* background-image: url("./toggle-off_dnd.svg"); */ background-color: ACCENT-DISABLED-COLOR; transition-duration: 100ms; } -/* toggle */ -.dnd-button .toggle-switch .handle { - /* toggle-switch height - handle margin * 2 */ - width: 16px; - height: 16px; - border-radius: 6px; - margin: 3px; -} - .dnd-button:hover .toggle-switch { background-color: ACCENT-DISABLED_HOVER; } .dnd-button .toggle-switch:checked { - /* background-image: url("./toggle-on_dnd.svg"); */ background-color: BUTTON-COLOR; } diff --git a/theme/gnome-shell_css/datemenu.css b/theme/gnome-shell/.css/datemenu.css similarity index 100% rename from theme/gnome-shell_css/datemenu.css rename to theme/gnome-shell/.css/datemenu.css diff --git a/theme/gnome-shell_css/entries.css b/theme/gnome-shell/.css/entries.css similarity index 100% rename from theme/gnome-shell_css/entries.css rename to theme/gnome-shell/.css/entries.css diff --git a/theme/gnome-shell_css/keyboard.css b/theme/gnome-shell/.css/keyboard.css similarity index 100% rename from theme/gnome-shell_css/keyboard.css rename to theme/gnome-shell/.css/keyboard.css diff --git a/theme/gnome-shell_css/loginlock.css b/theme/gnome-shell/.css/loginlock.css similarity index 100% rename from theme/gnome-shell_css/loginlock.css rename to theme/gnome-shell/.css/loginlock.css diff --git a/theme/gnome-shell_css/lookingglass.css b/theme/gnome-shell/.css/lookingglass.css similarity index 100% rename from theme/gnome-shell_css/lookingglass.css rename to theme/gnome-shell/.css/lookingglass.css diff --git a/theme/gnome-shell_css/messages.css b/theme/gnome-shell/.css/messages.css similarity index 100% rename from theme/gnome-shell_css/messages.css rename to theme/gnome-shell/.css/messages.css diff --git a/theme/gnome-shell_css/osd.css b/theme/gnome-shell/.css/osd.css similarity index 65% rename from theme/gnome-shell_css/osd.css rename to theme/gnome-shell/.css/osd.css index 52a01f9..7485f07 100644 --- a/theme/gnome-shell_css/osd.css +++ b/theme/gnome-shell/.css/osd.css @@ -65,19 +65,15 @@ /* Modal dialog */ .modal-dialog { border-radius: 20px; - padding: 0; /* 47+ */ + padding: 12px; background-color: BACKGROUND-COLOR; border: none; box-shadow: inset 0 0 0 1px BORDER-SHADOW; color: TEXT-PRIMARY-COLOR; } -.modal-dialog .modal-dialog-content-box { - margin: 32px 40px; /* bring it back because of https://gitlab.gnome.org/GNOME/gnome-shell/-/commit/a32f735ec09bc3bb0309818cfb15f313338f4c8c */ -} - .end-session-dialog { - width: 30em; /* revert changes on 47+ */ + width: 28em; } /* user avatar */ @@ -101,51 +97,24 @@ /* button in modals */ .modal-dialog-linked-button, -.notification-button, -.hotplug-notification-item { - padding: 10px 0 !important; - border-radius: 12px !important; +.notification-button { box-shadow: inset 0 0 0 1px BORDER-SHADOW; background-color: ACCENT-DISABLED-COLOR; color: TEXT-PRIMARY-COLOR; animation-duration: 100ms; } - -/* if first button: margin-right: 12px/2 */ -.modal-dialog-linked-button:ltr:first-child, -.notification-button:ltr:first-child, -.hotplug-notification-item:ltr:first-child, -.modal-dialog-linked-button:rtl:last-child, -.notification-button:rtl:last-child, -.hotplug-notification-item:rtl:last-child { - margin: 0 6px 12px 12px !important; +.modal-dialog-linked-button { + padding: 10px 0; + border-radius: 12px; } -/* if last button: margin-left: 12px/2 */ -.modal-dialog-linked-button:ltr:last-child, -.notification-button:ltr:last-child, -.hotplug-notification-item:ltr:last-child, -.modal-dialog-linked-button:rtl:first-child, -.notification-button:rtl:first-child, -.hotplug-notification-item:rtl:first-child { - margin: 0 12px 12px 6px !important; -} - -/* if only button: normal margin */ -.modal-dialog-linked-button:first-child:last-child, -.notification-button:first-child:last-child, -.hotplug-notification-item:first-child:last-child { - margin: 0 12px 12px 12px !important; -} - -/* else: margin-right/left: 12px/2 */ -.modal-dialog-linked-button, -.notification-button, -.hotplug-notification-item { - margin: 0 6px 12px 6px !important; +.notification-button { + padding: 7px 12px; + border-radius: 10px; } +/* see button spacing in ..46 and 47.. */ .modal-dialog-linked-button:hover, .modal-dialog-linked-button:focus, @@ -165,24 +134,19 @@ background-color: BUTTON_HOVER; } -.modal-dialog-linked-button:focus, -.hotplug-notification-item:focus, -.notification-button:focus { +.modal-dialog-linked-button:focus { animation-duration: 100ms; box-shadow: inset 0 0 0 1px TEXT-DISABLED-COLOR !important; } .modal-dialog-linked-button:focus:hover, -.hotplug-notification-item:focus:hover, .notification-button:focus:hover, .modal-dialog-linked-button:focus:active, -.hotplug-notification-item:focus:active, .notification-button:focus:active { box-shadow: inset 0 0 0 1px TEXT-SECONDARY-COLOR !important; } .modal-dialog .modal-dialog-linked-button:insensitive, -.hotplug-notification-item:insensitive, .notification-banner .notification-button:insensitive { color: BUTTON-TEXT_SECONDARY; background-color: BUTTON_INSENSITIVE; diff --git a/theme/gnome-shell_css/overview.css b/theme/gnome-shell/.css/overview.css similarity index 100% rename from theme/gnome-shell_css/overview.css rename to theme/gnome-shell/.css/overview.css diff --git a/theme/gnome-shell_css/panel.css b/theme/gnome-shell/.css/panel.css similarity index 100% rename from theme/gnome-shell_css/panel.css rename to theme/gnome-shell/.css/panel.css diff --git a/theme/gnome-shell_css/popovers.css b/theme/gnome-shell/.css/popovers.css similarity index 100% rename from theme/gnome-shell_css/popovers.css rename to theme/gnome-shell/.css/popovers.css diff --git a/theme/gnome-shell_css/quick-settings.css b/theme/gnome-shell/.css/quick-settings.css similarity index 98% rename from theme/gnome-shell_css/quick-settings.css rename to theme/gnome-shell/.css/quick-settings.css index 3242ea8..4585604 100644 --- a/theme/gnome-shell_css/quick-settings.css +++ b/theme/gnome-shell/.css/quick-settings.css @@ -2,7 +2,7 @@ /* QS section */ .quick-settings { - padding: 18px; + padding: 15px; border-radius: 24px; } @@ -93,7 +93,7 @@ .quick-slider .slider-bin { padding: 4px; margin: 0; - color: BUTTON-TEXT-COLOR; + color: BUTTON-TEXT-COLOR; /* up tp 46 */ border-radius: 99px; } diff --git a/theme/gnome-shell_css/screenshot.css b/theme/gnome-shell/.css/screenshot.css similarity index 100% rename from theme/gnome-shell_css/screenshot.css rename to theme/gnome-shell/.css/screenshot.css diff --git a/theme/gnome-shell_css/search.css b/theme/gnome-shell/.css/search.css similarity index 100% rename from theme/gnome-shell_css/search.css rename to theme/gnome-shell/.css/search.css diff --git a/theme/gnome-shell/.versions/..46/.css/buttons.css b/theme/gnome-shell/.versions/..46/.css/buttons.css new file mode 100644 index 0000000..2e4d013 --- /dev/null +++ b/theme/gnome-shell/.versions/..46/.css/buttons.css @@ -0,0 +1,33 @@ +/* if first button: margin-right: 12px/2 */ +.modal-dialog-linked-button:ltr:first-child, +.notification-button:ltr:first-child, +.hotplug-notification-item:ltr:first-child, +.modal-dialog-linked-button:rtl:last-child, +.notification-button:rtl:last-child, +.hotplug-notification-item:rtl:last-child { + margin: 0 6px 0 0 !important; +} + +/* if last button: margin-left: 12px/2 */ +.modal-dialog-linked-button:ltr:last-child, +.notification-button:ltr:last-child, +.hotplug-notification-item:ltr:last-child, +.modal-dialog-linked-button:rtl:first-child, +.notification-button:rtl:first-child, +.hotplug-notification-item:rtl:first-child { + margin: 0 0 0 6px !important; +} + +/* if only button: normal margin */ +.modal-dialog-linked-button:first-child:last-child, +.notification-button:first-child:last-child, +.hotplug-notification-item:first-child:last-child { + margin: 0 !important; +} + +/* else: margin-right/left: 12px/2 */ +.modal-dialog-linked-button, +.notification-button, +.hotplug-notification-item { + margin: 0 6px !important; +} \ No newline at end of file diff --git a/theme/gnome-shell/.versions/..46/.css/toggle.css b/theme/gnome-shell/.versions/..46/.css/toggle.css new file mode 100644 index 0000000..4d9274b --- /dev/null +++ b/theme/gnome-shell/.versions/..46/.css/toggle.css @@ -0,0 +1,15 @@ +.toggle-switch { + background-image: url("./toggle-off.svg"); +} + +.toggle-switch:checked { + background-image: url("./toggle-on.svg"); +} + +.dnd-button .toggle-switch { + background-image: url("./toggle-off_dnd.svg"); +} + +.dnd-button .toggle-switch:checked { + background-image: url("./toggle-on_dnd.svg"); +} \ No newline at end of file diff --git a/theme/gnome-shell/toggle-off.svg b/theme/gnome-shell/.versions/..46/toggle-off.svg similarity index 100% rename from theme/gnome-shell/toggle-off.svg rename to theme/gnome-shell/.versions/..46/toggle-off.svg diff --git a/theme/gnome-shell/toggle-off_dnd.svg b/theme/gnome-shell/.versions/..46/toggle-off_dnd.svg similarity index 100% rename from theme/gnome-shell/toggle-off_dnd.svg rename to theme/gnome-shell/.versions/..46/toggle-off_dnd.svg diff --git a/theme/gnome-shell/toggle-on.svg b/theme/gnome-shell/.versions/..46/toggle-on.svg similarity index 100% rename from theme/gnome-shell/toggle-on.svg rename to theme/gnome-shell/.versions/..46/toggle-on.svg diff --git a/theme/gnome-shell/toggle-on_dnd.svg b/theme/gnome-shell/.versions/..46/toggle-on_dnd.svg similarity index 100% rename from theme/gnome-shell/toggle-on_dnd.svg rename to theme/gnome-shell/.versions/..46/toggle-on_dnd.svg diff --git a/theme/gnome-shell/.versions/47../.css/buttons.css b/theme/gnome-shell/.versions/47../.css/buttons.css new file mode 100644 index 0000000..f134fc4 --- /dev/null +++ b/theme/gnome-shell/.versions/47../.css/buttons.css @@ -0,0 +1,7 @@ +.modal-dialog-linked-button { + margin: 0; +} + +.notification-buttons-bin { + spacing: 1px; +} \ No newline at end of file diff --git a/theme/gnome-shell/.versions/47../.css/toggle.css b/theme/gnome-shell/.versions/47../.css/toggle.css new file mode 100644 index 0000000..85b6521 --- /dev/null +++ b/theme/gnome-shell/.versions/47../.css/toggle.css @@ -0,0 +1,19 @@ +.toggle-switch .handle { + /* toggle-switch height - handle margin * 2 */ + width: 14px; + height: 14px; + margin: 2px; + background-color: TEXT-SECONDARY-COLOR; +} + +.toggle-switch:checked .handle { + background-color: BUTTON-TEXT-COLOR; +} + +.dnd-button .toggle-switch .handle { + /* toggle-switch height - handle margin * 2 */ + width: 16px; + height: 16px; + border-radius: 6px; + margin: 3px; +} \ No newline at end of file