diff --git a/README.md b/README.md index dec04b0..d68d439 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,7 @@ These themes have been tested and work: - Matcha (Manjaro default) - Materia - Mojave +- Plata - Pop (Pop!_OS default) - Qogir - Teja diff --git a/ego_description.txt b/ego_description.txt index c297c3e..57ea9c5 100644 --- a/ego_description.txt +++ b/ego_description.txt @@ -13,6 +13,7 @@ These themes have been tested and work: - Matcha (Manjaro default) - Materia - Mojave +- Plata - Pop (Pop!_OS default) - Qogir - Teja diff --git a/src/modules/Variants.js b/src/modules/Variants.js index 4390850..6c7623a 100644 --- a/src/modules/Variants.js +++ b/src/modules/Variants.js @@ -80,6 +80,10 @@ var Variants = class { variants.set('day', name.replace('-dark', '-light')); variants.set('night', variants.get('day').replace('-light', '-dark')); } + else if ( name.includes('Plata') ) { + variants.set('day', name.replace('-Noir', '')); + variants.set('night', variants.get('day').replace(/Plata(-Lumine)?/, 'Plata-Noir')); + } else if ( name.includes('Teja') ) { const dark_variant = '_' + (name.replace('_Light').split('_')[1] || 'Dark'); variants.set('day', name.replace(/(_Dark(est)?|_Black)/, '')); diff --git a/tests/Plata.js b/tests/Plata.js new file mode 100644 index 0000000..9529341 --- /dev/null +++ b/tests/Plata.js @@ -0,0 +1,41 @@ +/* +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 . +*/ + +const test = require('ava'); +const { Variants } = require('./_variants'); + + +['', '-Compact'].forEach(size => { + test(`Plata${size}`, t => { + const variants = Variants.guess_from(`Plata${size}`); + t.is(variants.get('day'), `Plata${size}`); + t.is(variants.get('night'), `Plata-Noir${size}`); + }); + + test(`Plata-Noir${size}`, t => { + const variants = Variants.guess_from(`Plata-Noir${size}`); + t.is(variants.get('day'), `Plata${size}`); + t.is(variants.get('night'), `Plata-Noir${size}`); + }); + + test(`Plata-Lumine${size}`, t => { + const variants = Variants.guess_from(`Plata-Lumine${size}`); + t.is(variants.get('day'), `Plata-Lumine${size}`); + t.is(variants.get('night'), `Plata-Noir${size}`); + }); +})