Add Zorin themes support
This commit is contained in:
@@ -16,8 +16,6 @@ Supports Night Light, Location Services, manual schedule and on-demand switch.
|
|||||||
## Table of contents <!-- omit in toc -->
|
## Table of contents <!-- omit in toc -->
|
||||||
|
|
||||||
- [Theme compatibility](#theme-compatibility)
|
- [Theme compatibility](#theme-compatibility)
|
||||||
- [GTK themes](#gtk-themes)
|
|
||||||
- [Shell themes](#shell-themes)
|
|
||||||
- [Graphical installation](#graphical-installation)
|
- [Graphical installation](#graphical-installation)
|
||||||
- [Command line installation](#command-line-installation)
|
- [Command line installation](#command-line-installation)
|
||||||
- [Contributing](#contributing)
|
- [Contributing](#contributing)
|
||||||
@@ -28,7 +26,8 @@ Supports Night Light, Location Services, manual schedule and on-demand switch.
|
|||||||
|
|
||||||
These themes have been tested and work out of the box without any configuration. Other themes might work as well, let me know if there is a specific theme you'd like supported! And you can also manually set your day and night variants.
|
These themes have been tested and work out of the box without any configuration. Other themes might work as well, let me know if there is a specific theme you'd like supported! And you can also manually set your day and night variants.
|
||||||
|
|
||||||
### GTK themes
|
<details>
|
||||||
|
<summary>GTK themes</summary>
|
||||||
|
|
||||||
- Adapta
|
- Adapta
|
||||||
- Adwaita (GNOME & Fedora default)
|
- Adwaita (GNOME & Fedora default)
|
||||||
@@ -58,8 +57,12 @@ These themes have been tested and work out of the box without any configuration.
|
|||||||
- WhiteSur
|
- WhiteSur
|
||||||
- Yaru (Ubuntu default)
|
- Yaru (Ubuntu default)
|
||||||
- Yaru Colors
|
- Yaru Colors
|
||||||
|
- Zorin
|
||||||
|
|
||||||
### Shell themes
|
</details>
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Shell themes</summary>
|
||||||
|
|
||||||
- Adapta
|
- Adapta
|
||||||
- Adwaita Colors
|
- Adwaita Colors
|
||||||
@@ -83,6 +86,9 @@ These themes have been tested and work out of the box without any configuration.
|
|||||||
- Vimix
|
- Vimix
|
||||||
- WhiteSur
|
- WhiteSur
|
||||||
- Yaru Colors
|
- Yaru Colors
|
||||||
|
- Zorin
|
||||||
|
|
||||||
|
</details>
|
||||||
|
|
||||||
## Graphical installation
|
## Graphical installation
|
||||||
|
|
||||||
|
|||||||
@@ -83,6 +83,9 @@ var GtkVariants = class {
|
|||||||
} else if (name.includes('vimix')) {
|
} else if (name.includes('vimix')) {
|
||||||
variants.set(Time.DAY, name.replace('-dark', ''));
|
variants.set(Time.DAY, name.replace('-dark', ''));
|
||||||
variants.set(Time.NIGHT, variants.get(Time.DAY).replace(/vimix(-light)?/, 'vimix-dark'));
|
variants.set(Time.NIGHT, variants.get(Time.DAY).replace(/vimix(-light)?/, 'vimix-dark'));
|
||||||
|
} else if (name.includes('Zorin')) {
|
||||||
|
variants.set(Time.DAY, name.replace('-Dark', '-Light'));
|
||||||
|
variants.set(Time.NIGHT, variants.get(Time.DAY).replace('-Light', '-Dark'));
|
||||||
} else {
|
} else {
|
||||||
variants.set(Time.DAY, name.replace(/-dark(?!er)(est)?/, ''));
|
variants.set(Time.DAY, name.replace(/-dark(?!er)(est)?/, ''));
|
||||||
variants.set(Time.NIGHT, variants.get(Time.DAY).replace(/(-light|-darker)/, '') + (name.includes('-darkest') ? '-darkest' : '-dark'));
|
variants.set(Time.NIGHT, variants.get(Time.DAY).replace(/(-light|-darker)/, '') + (name.includes('-darkest') ? '-darkest' : '-dark'));
|
||||||
|
|||||||
@@ -80,6 +80,9 @@ var ShellVariants = class {
|
|||||||
} else if (name.includes('vimix')) {
|
} else if (name.includes('vimix')) {
|
||||||
variants.set(Time.DAY, name.replace('-dark', ''));
|
variants.set(Time.DAY, name.replace('-dark', ''));
|
||||||
variants.set(Time.NIGHT, variants.get(Time.DAY).replace(/vimix(-light)?/, 'vimix-dark'));
|
variants.set(Time.NIGHT, variants.get(Time.DAY).replace(/vimix(-light)?/, 'vimix-dark'));
|
||||||
|
} else if (name.includes('Zorin')) {
|
||||||
|
variants.set(Time.DAY, name.replace('-Dark', '-Light'));
|
||||||
|
variants.set(Time.NIGHT, variants.get(Time.DAY).replace('-Light', '-Dark'));
|
||||||
} else {
|
} else {
|
||||||
variants.set(Time.DAY, name.replace(/-dark(?!er)(est)?/, ''));
|
variants.set(Time.DAY, name.replace(/-dark(?!er)(est)?/, ''));
|
||||||
variants.set(Time.NIGHT, variants.get(Time.DAY).replace(/(-light|-darker)/, '') + (name.includes('-darkest') ? '-darkest' : '-dark'));
|
variants.set(Time.NIGHT, variants.get(Time.DAY).replace(/(-light|-darker)/, '') + (name.includes('-darkest') ? '-darkest' : '-dark'));
|
||||||
|
|||||||
@@ -0,0 +1,20 @@
|
|||||||
|
// SPDX-FileCopyrightText: 2021 Romain Vigier <contact AT romainvigier.fr>
|
||||||
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
|
const test = require('ava');
|
||||||
|
const { Variants } = require('./_variants');
|
||||||
|
|
||||||
|
|
||||||
|
['Blue', 'Green', 'Grey', 'Orange', 'Purple', 'Red'].forEach(color => {
|
||||||
|
test(`Zorin${color}-Light`, t => {
|
||||||
|
const variants = Variants.guessFrom(`Zorin${color}-Light`);
|
||||||
|
t.is(variants.get('day'), `Zorin${color}-Light`);
|
||||||
|
t.is(variants.get('night'), `Zorin${color}-Dark`);
|
||||||
|
});
|
||||||
|
|
||||||
|
test(`Zorin${color}-Dark`, t => {
|
||||||
|
const variants = Variants.guessFrom(`Zorin${color}-Dark`);
|
||||||
|
t.is(variants.get('day'), `Zorin${color}-Light`);
|
||||||
|
t.is(variants.get('night'), `Zorin${color}-Dark`);
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
// SPDX-FileCopyrightText: 2021 Romain Vigier <contact AT romainvigier.fr>
|
||||||
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
|
const test = require('ava');
|
||||||
|
const { Variants } = require('./_variants');
|
||||||
|
|
||||||
|
|
||||||
|
['Blue', 'Green', 'Grey', 'Orange', 'Purple', 'Red'].forEach(color => {
|
||||||
|
test(`Zorin${color}-Light`, t => {
|
||||||
|
const variants = Variants.guessFrom(`Zorin${color}-Light`);
|
||||||
|
t.is(variants.get('day'), `Zorin${color}-Light`);
|
||||||
|
t.is(variants.get('night'), `Zorin${color}-Dark`);
|
||||||
|
});
|
||||||
|
|
||||||
|
test(`Zorin${color}-Dark`, t => {
|
||||||
|
const variants = Variants.guessFrom(`Zorin${color}-Dark`);
|
||||||
|
t.is(variants.get('day'), `Zorin${color}-Light`);
|
||||||
|
t.is(variants.get('night'), `Zorin${color}-Dark`);
|
||||||
|
});
|
||||||
|
});
|
||||||
Reference in New Issue
Block a user