From 48fd2119a79dac1fd30a9308c43001f7573b2f56 Mon Sep 17 00:00:00 2001 From: Romain Vigier Date: Sat, 1 Feb 2020 10:10:32 +0100 Subject: [PATCH] Add support for Mojave GTK themes, bump to v12 --- README.md | 1 + src/extension.js | 6 +++++- src/metadata.json | 4 ++-- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index fa88e42..ea58b69 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,7 @@ These themes have been tested and work: - HighContrast - Matcha (thank you @Chrysostomus) - Materia +- Mojave - Yaru Let me know if the theme you use works as well, or if it doesn't, I can try to make it work. diff --git a/src/extension.js b/src/extension.js index ed7c076..e6a7417 100644 --- a/src/extension.js +++ b/src/extension.js @@ -1,7 +1,7 @@ /* Night Theme Switcher Gnome Shell extension -Copyright (C) 2019 Romain Vigier +Copyright (C) 2019, 2020 Romain Vigier Copyright (C) 2020 Matti Hyttinen This program is free software: you can redistribute it and/or modify it under @@ -187,6 +187,10 @@ class Variants { variants.day = name.replace(/-dark-/g, '-'); variants.night = variants.day.replace('Matcha-', 'Matcha-dark-'); } + else if ( name.includes('Mojave') ) { + variants.day = name.replace('-dark', '-light'); + variants.night = variants.day.replace('-light', '-dark'); + } else { variants.day = name.replace(/-dark(?!er)/g, ''); variants.night = variants.day.replace(/(-light)?(-darker)?/g, '') + '-dark'; diff --git a/src/metadata.json b/src/metadata.json index 50df6ac..4b713ac 100644 --- a/src/metadata.json +++ b/src/metadata.json @@ -1,9 +1,9 @@ { "name": "Night Theme Switcher", - "description": "Automatically change the GTK theme to dark variant when Night Light activates.\n\nTHEME COMPATIBILITY:\nYour theme must have a `-dark` variant, e.g. `Adwaita` and `Adwaita-dark`.\nThese themes have been tested and work:\n- Adwaita\n- Arc\n- HighContrast\n- Matcha\n- Materia\n- Yaru\n\nLet me know if the theme you use works as well, or if it doesn't, I can try to make it work.\n\nDo you need to change your GNOME shell theme as well? Try Night Shell Switcher! https://extensions.gnome.org/extension/2356/night-shell-switcher/", + "description": "Automatically change the GTK theme to dark variant when Night Light activates.\n\nTHEME COMPATIBILITY:\nYour theme must have a `-dark` variant, e.g. `Adwaita` and `Adwaita-dark`.\nThese themes have been tested and work:\n- Adwaita\n- Arc\n- HighContrast\n- Matcha\n- Materia\n- Mojave\n- Yaru\n\nLet me know if the theme you use works as well, or if it doesn't, I can try to make it work.\n\nDo you need to change your GNOME shell theme as well? Try Night Shell Switcher! https://extensions.gnome.org/extension/2356/night-shell-switcher/", "uuid": "nightthemeswitcher@romainvigier.fr", "url": "https://gitlab.com/rmnvgr/nightthemeswitcher-gnome-shell-extension/", - "version": 11, + "version": 12, "shell-version": ["3.32", "3.34"], "gettext-domain": "nightthemeswitcher@romainvigier.fr" }