Add support for WhiteSur theme

This commit is contained in:
Romain Vigier
2020-08-10 11:43:08 +02:00
parent 035c117a14
commit 774b994de3
5 changed files with 78 additions and 2 deletions
+2
View File
@@ -37,6 +37,7 @@ These themes have been tested and work out of the box without any configuration.
- Simply Circles
- Teja
- Vimix
- WhiteSur
- Yaru (Ubuntu default)
- Yaru Colors
@@ -61,6 +62,7 @@ These themes have been tested and work out of the box without any configuration.
- Simply Circles
- Teja
- Vimix
- WhiteSur
- Yaru Colors
## Graphical installation
+1 -1
View File
@@ -75,7 +75,7 @@ var GtkVariants = class {
const version = name.split('-').pop();
variants.set('day', `McOS-CTLina-Gnome-${version}`);
variants.set('night', `Mc-OS-CTLina-Gnome-Dark-${version}`);
} else if (name.includes('Mojave')) {
} else if (name.match(/^(Mojave|WhiteSur)/)) {
variants.set('day', name.replace('-dark', '-light'));
variants.set('night', variants.get('day').replace('-light', '-dark'));
} else if (name.includes('Plata')) {
+1 -1
View File
@@ -75,7 +75,7 @@ var ShellVariants = class {
const version = name.split('-').pop();
variants.set('day', `McOS-CTLina-Gnome-${version}`);
variants.set('night', `Mc-OS-CTLina-Gnome-Dark-${version}`);
} else if (name.includes('Mojave')) {
} else if (name.match(/^(Mojave|WhiteSur)/)) {
variants.set('day', name.replace('-dark', '-light'));
variants.set('night', variants.get('day').replace('-light', '-dark'));
} else if (name.includes('Plata')) {
+37
View File
@@ -0,0 +1,37 @@
/*
Night Theme Switcher Gnome Shell extension
Copyright (C) 2020 Romain Vigier
This program is free software: you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation, either version 3 of the License, or (at your option) any later
version.
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
this program. If not, see <http s ://www.gnu.org/licenses/>.
*/
const test = require('ava');
const { Variants } = require('./_variants');
['', '-solid'].forEach(transparency => {
['', '-alt'].forEach(alt => {
test(`WhiteSur-light${transparency}${alt}`, t => {
const variants = Variants.guessFrom(`WhiteSur-light${transparency}${alt}`);
t.is(variants.get('day'), `WhiteSur-light${transparency}${alt}`);
t.is(variants.get('night'), `WhiteSur-dark${transparency}${alt}`);
});
test(`WhiteSur-dark${transparency}${alt}`, t => {
const variants = Variants.guessFrom(`WhiteSur-dark${transparency}${alt}`);
t.is(variants.get('day'), `WhiteSur-light${transparency}${alt}`);
t.is(variants.get('night'), `WhiteSur-dark${transparency}${alt}`);
});
});
});
+37
View File
@@ -0,0 +1,37 @@
/*
Night Theme Switcher Gnome Shell extension
Copyright (C) 2020 Romain Vigier
This program is free software: you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation, either version 3 of the License, or (at your option) any later
version.
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
this program. If not, see <http s ://www.gnu.org/licenses/>.
*/
const test = require('ava');
const { Variants } = require('./_variants');
['', '-solid'].forEach(transparency => {
['', '-alt'].forEach(alt => {
test(`WhiteSur-light${transparency}${alt}`, t => {
const variants = Variants.guessFrom(`WhiteSur-light${transparency}${alt}`);
t.is(variants.get('day'), `WhiteSur-light${transparency}${alt}`);
t.is(variants.get('night'), `WhiteSur-dark${transparency}${alt}`);
});
test(`WhiteSur-dark${transparency}${alt}`, t => {
const variants = Variants.guessFrom(`WhiteSur-dark${transparency}${alt}`);
t.is(variants.get('day'), `WhiteSur-light${transparency}${alt}`);
t.is(variants.get('night'), `WhiteSur-dark${transparency}${alt}`);
});
});
});