Compare commits
14 Commits
v1.0.0-rc1
...
v1.0.0-alp
Author | SHA1 | Date | |
---|---|---|---|
|
7f05c31d3e | ||
|
bc140eefe4 | ||
|
043ff54ad0 | ||
|
e18e098571 | ||
|
ab13e83374 | ||
|
aa86808ac7 | ||
|
f31af15412 | ||
|
1585bdacf7 | ||
|
41858b3d68 | ||
|
c935fdec51 | ||
|
2eca1a605f | ||
|
3501174789 | ||
|
2becf63d9c | ||
|
6323311752 |
9
.github/workflows/release.yml
vendored
9
.github/workflows/release.yml
vendored
@@ -6,6 +6,9 @@ on:
|
|||||||
- "v*"
|
- "v*"
|
||||||
jobs:
|
jobs:
|
||||||
release:
|
release:
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
flavor: [mocha, macchiato, latte, frappe]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
@@ -21,11 +24,7 @@ jobs:
|
|||||||
- name: Install colloid specific dependencies
|
- name: Install colloid specific dependencies
|
||||||
run: sudo apt update && sudo apt install -y sassc inkscape optipng
|
run: sudo apt update && sudo apt install -y sassc inkscape optipng
|
||||||
- name: Generate themes
|
- name: Generate themes
|
||||||
run: |
|
run: python ./build.py ${{ matrix.flavor }} -a all --zip -d $PWD/releases
|
||||||
python ./build.py mocha -a all --zip -d $PWD/releases &&
|
|
||||||
python ./build.py macchiato -a all --zip -d $PWD/releases &&
|
|
||||||
python ./build.py frappe -a all --zip -d $PWD/releases &&
|
|
||||||
python ./build.py latte -a all --zip -d $PWD/releases
|
|
||||||
- name: Add zips to release
|
- name: Add zips to release
|
||||||
uses: softprops/action-gh-release@v2
|
uses: softprops/action-gh-release@v2
|
||||||
with:
|
with:
|
||||||
|
208
README.md
208
README.md
@@ -15,72 +15,39 @@
|
|||||||
<img src="assets/res.webp"/>
|
<img src="assets/res.webp"/>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
This GTK theme is based on the [Colloid](https://github.com/vinceliuice/Colloid-gtk-theme) theme made by [vinceliuice](https://github.com/vinceliuice)
|
# About
|
||||||
|
|
||||||
|
This GTK theme is based on the [Colloid](https://github.com/vinceliuice/Colloid-gtk-theme) theme made by [Vinceliuice](https://github.com/vinceliuice)
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
### Requirements
|
### Requirements
|
||||||
|
|
||||||
- GTK >=3.20
|
- GTK `>=3.20`
|
||||||
- `python3`
|
|
||||||
- `gnome-themes-extra` (or `gnome-themes-standard`)
|
- `gnome-themes-extra` (or `gnome-themes-standard`)
|
||||||
|
|
||||||
To build the theme, make sure the following packages are installed:
|
### Installation
|
||||||
- `sassc`
|
|
||||||
- `inkscape`
|
|
||||||
- `optipng`
|
|
||||||
|
|
||||||
### Manually
|
1. Download and extract the theme zip from [releases](https://github.com/catppuccin/gtk/releases/).
|
||||||
|
2. Move the theme folder to **".themes"** in your home directory. **(~/.themes)** (Skip this step if you are using the AUR package)
|
||||||
|
3. Select the downloaded theme via your desktop specific tweaks application (**gnome-tweaks** on Gnome 3+).
|
||||||
|
|
||||||
1. Download and extract the theme zip from the [latest release](https://github.com/catppuccin/gtk/releases/latest/).
|
### For Arch Linux users
|
||||||
2. Move the theme folder to the `~/.local/share/themes` directory.
|
|
||||||
3. Select the downloaded theme via your desktop specific tweaks application (GNOME Tweaks on GNOME 3+).
|
|
||||||
4. To theme other apps that are using GTK, make sure to run the following command:
|
|
||||||
```bash
|
|
||||||
export THEME_DIR="~/.local/share/themes/catppuccin-<flavor>-<accent>-standard+default"
|
|
||||||
mkdir -p "${HOME}/.config/gtk-4.0" &&
|
|
||||||
ln -sf "${THEME_DIR}/gtk-4.0/assets" "${HOME}/.config/gtk-4.0/assets" &&
|
|
||||||
ln -sf "${THEME_DIR}/gtk-4.0/gtk.css" "${HOME}/.config/gtk-4.0/gtk.css" &&
|
|
||||||
ln -sf "${THEME_DIR}/gtk-4.0/gtk-dark.css" "${HOME}/.config/gtk-4.0/gtk-dark.css"
|
|
||||||
```
|
|
||||||
|
|
||||||
### Flatpak
|
We have 4 AUR packages for all the 4 flavours of the theme:
|
||||||
|
|
||||||
In order for Flatpak to access the theme, make sure to run the following command:
|
- [Latte](https://aur.archlinux.org/packages/catppuccin-gtk-theme-latte)
|
||||||
```bash
|
- [Frappe](https://aur.archlinux.org/packages/catppuccin-gtk-theme-frappe)
|
||||||
sudo flatpak override --filesystem=$HOME/.local/share/themes
|
- [Macchiato](https://aur.archlinux.org/packages/catppuccin-gtk-theme-macchiato)
|
||||||
```
|
- [Mocha](https://aur.archlinux.org/packages/catppuccin-gtk-theme-mocha)
|
||||||
|
|
||||||
Then, run the following command to apply the theme.
|
With your favourite AUR helper, install them:
|
||||||
```bash
|
|
||||||
export THEME_DIR="~/.local/share/themes/catppuccin-<flavor>-<accent>-standard+default"
|
|
||||||
sudo flatpak override --env=GTK_THEME=$THEME_DIR
|
|
||||||
```
|
|
||||||
|
|
||||||
### Using the install script to install the theme
|
|
||||||
|
|
||||||
To install the theme using the install script, run `install.py`:
|
|
||||||
```
|
|
||||||
python3 install.py <flavor> <accent>
|
|
||||||
```
|
|
||||||
|
|
||||||
If you have adwaita installed, make sure to include `--link` in order to add symlinks for it:
|
|
||||||
```
|
|
||||||
python3 install.py <flavor> <accent> --link
|
|
||||||
```
|
|
||||||
Run the command and the gtk theme should be installed!
|
|
||||||
|
|
||||||
### AUR
|
|
||||||
|
|
||||||
We have 4 AUR packages for all the 4 flavours (Latte, Frappe, Macchiato, Mocha)
|
|
||||||
|
|
||||||
With your favourite AUR helper, you can install one of these flavors:
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
yay -S catppuccin-gtk-theme-<flavor>
|
yay -S catppuccin-gtk-theme-mocha catppuccin-gtk-theme-macchiato catppuccin-gtk-theme-frappe catppuccin-gtk-theme-latte
|
||||||
```
|
```
|
||||||
|
|
||||||
### Nix
|
### For Nix users
|
||||||
|
|
||||||
We suggest you use [catppuccin/nix](https://github.com/catppuccin/nix).
|
We suggest you use [catppuccin/nix](https://github.com/catppuccin/nix).
|
||||||
Alternatively, you can use [catppuccin-gtk](https://github.com/NixOS/nixpkgs/blob/master/pkgs/data/themes/catppuccin-gtk/default.nix) from nixpkgs.
|
Alternatively, you can use [catppuccin-gtk](https://github.com/NixOS/nixpkgs/blob/master/pkgs/data/themes/catppuccin-gtk/default.nix) from nixpkgs.
|
||||||
@@ -105,12 +72,143 @@ Alternatively, you can use [catppuccin-gtk](https://github.com/NixOS/nixpkgs/blo
|
|||||||
> [!TIP]
|
> [!TIP]
|
||||||
> For further information on the options available, see the [full documentation](https://github.com/catppuccin/nix/blob/main/docs/home-manager-options.md#gtkcatppuccinenable).
|
> For further information on the options available, see the [full documentation](https://github.com/catppuccin/nix/blob/main/docs/home-manager-options.md#gtkcatppuccinenable).
|
||||||
|
|
||||||
### For Other Distros
|
### For GTK 4 users
|
||||||
|
|
||||||
Refer to [Using the install script to install the theme](https://github.com/catppuccin/gtk/edit/refactor/build-system/README.md#installing-the-theme-manually) or [Installing the theme manually](https://github.com/catppuccin/gtk/edit/refactor/build-system/README.md#installing-the-theme-manually).
|
To theme GTK 4 applications you have to manually symlink the `~/.config/gtk-4.0/` to the themes folder. Use the following commands
|
||||||
|
|
||||||
### Theming the GDM Theme
|
```bash
|
||||||
In order to theme the GDM theme, install the `gdm-settings` app, select the Catppuccin theme, and click *Save*.
|
mkdir -p "${HOME}/.config/gtk-4.0"
|
||||||
|
ln -sf "${THEME_DIR}/gtk-4.0/assets" "${HOME}/.config/gtk-4.0/assets"
|
||||||
|
ln -sf "${THEME_DIR}/gtk-4.0/gtk.css" "${HOME}/.config/gtk-4.0/gtk.css"
|
||||||
|
ln -sf "${THEME_DIR}/gtk-4.0/gtk-dark.css" "${HOME}/.config/gtk-4.0/gtk-dark.css"
|
||||||
|
```
|
||||||
|
|
||||||
|
### For Flatpak users
|
||||||
|
|
||||||
|
1. To give your Flatpaks access to your themes folder run:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo flatpak override --filesystem=$HOME/.themes
|
||||||
|
```
|
||||||
|
|
||||||
|
2. To set the theme for all Flatpaks, replace `##theme##` with the name of the theme you want to use and run this command:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo flatpak override --env=GTK_THEME=##theme##
|
||||||
|
```
|
||||||
|
|
||||||
|
3. For a more in depth tutorial see Hamza Algohary's tutorial on [It's FOSS](https://itsfoss.com/flatpak-app-apply-theme/)
|
||||||
|
|
||||||
|
### Handling GTK theme installation from window manager
|
||||||
|
|
||||||
|
1. Install unzip and curl.
|
||||||
|
2. Go to your window manager config file.
|
||||||
|
3. Add an entrance to the config file to be executed when your window manager is loaded.
|
||||||
|
- i3/sway example:
|
||||||
|
```
|
||||||
|
# catppuccin
|
||||||
|
set $ctp-version v0.6.1
|
||||||
|
exec_always if [ ! -e ~/.themes/Catppuccin-Frappe-Standard-Lavender-dark ]; then \
|
||||||
|
mkdir -p ~/.themes \
|
||||||
|
&& curl -L https://github.com/catppuccin/gtk/releases/download/$ctp-version/Catppuccin-Frappe-Standard-Lavender-dark.zip -o ~/.themes/catppuccin.zip \
|
||||||
|
&& unzip ~/.themes/catppuccin.zip -d ~/.themes/ \
|
||||||
|
&& rm -rf ~/.themes/catppuccin.zip; fi
|
||||||
|
```
|
||||||
|
> Note: The previous example execute that script every time i3/sway is reloaded.
|
||||||
|
4. Set the GTK_THEME environment variable:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
export GTK_THEME='Catppuccin-Frappe-Standard-Lavender-dark:dark'
|
||||||
|
```
|
||||||
|
|
||||||
|
> [!NOTE]
|
||||||
|
> in order to update the theme's version, just change the variable `$ctp-version`.
|
||||||
|
|
||||||
|
### GDM Theme
|
||||||
|
|
||||||
|
> [!WARNING]
|
||||||
|
> Applying a custom theme to GDM is not recommended as it is not themeable, however you can do it through certain *hacks*.
|
||||||
|
|
||||||
|
To apply the theme to GDM, A new `gnome-shell-theme.gresource.xml` needs to be complied.
|
||||||
|
To achieve this, you can run the following:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Backup the current gresource file.
|
||||||
|
sudo cp -av /usr/share/gnome-shell/gnome-shell-theme.gresource{,~}
|
||||||
|
sudo glib-compile-resources --target="/usr/share/gnome-shell/gnome-shell-theme.gresource" --sourcedir="$THEME_DIR" "$THEME_DIR/gnome-shell-theme.gresource.xml"
|
||||||
|
```
|
||||||
|
|
||||||
|
Make sure to replace `$THEME_DIR` to where the theme was extracted accordingly.
|
||||||
|
|
||||||
|
- For nix users, it'll be the nix store path of the package.
|
||||||
|
- For AUR users, it'll be in `~/.themes`
|
||||||
|
- Otherwise, it'll be wherever you extracted the theme.
|
||||||
|
|
||||||
|
### Using the script
|
||||||
|
|
||||||
|
**Note**: Ensure that you have at least Python version 3.10 installed
|
||||||
|
|
||||||
|
Set up the installer using
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git clone --recurse-submodules git@github.com:catppuccin/gtk.git
|
||||||
|
cd gtk
|
||||||
|
virtualenv -p python3 venv # to be created only once and only if you need a virtual env
|
||||||
|
source venv/bin/activate
|
||||||
|
pip install -r requirements.txt
|
||||||
|
```
|
||||||
|
|
||||||
|
To check out the install script, run
|
||||||
|
|
||||||
|
```bash
|
||||||
|
python install.py --help
|
||||||
|
```
|
||||||
|
|
||||||
|
> Tip: `python install.py --help` allows the following options:
|
||||||
|
|
||||||
|
```
|
||||||
|
Compulsory field Specify color variant(s) [mocha|frappe|macchiato|latte|all]
|
||||||
|
-d, --dest DIR Specify destination directory (Default: ~/.themes)
|
||||||
|
-n, --name NAME Specify theme name (Default: Colloid)
|
||||||
|
-a, --accent VARIANT... Specify theme color variant(s) [rosewater|flamingo|pink|mauve|red|maroon|peach|yellow|green|teal|sky|
|
||||||
|
sapphire|blue|lavender|all] (Default: blue)
|
||||||
|
-s, --size VARIANT... Specify size variant [standard|compact] (Default: standard variant)
|
||||||
|
-l, --link Link installed gtk-4.0 theme to config folder for all libadwaita app use this theme
|
||||||
|
--zip Zips up the finally produced themes.
|
||||||
|
--tweaks Specify versions for tweaks [black|rimless|normal|float]
|
||||||
|
1. black: Blackness color version
|
||||||
|
2. rimless: Remove the 1px border about windows and menus
|
||||||
|
3. normal: Normal windows button style (titlebuttons: max/min/close)
|
||||||
|
4. float: Floating gnome-shell panel style
|
||||||
|
-h, --help Show help
|
||||||
|
```
|
||||||
|
|
||||||
|
You can install any theme like the following example
|
||||||
|
|
||||||
|
```bash
|
||||||
|
python install.py mocha -a sky --tweaks rimless -d ~/.themes
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
You can build all possible variations of the theme possible using the following command and it will install it to releases folder
|
||||||
|
|
||||||
|
```bash
|
||||||
|
python install.py all -a all
|
||||||
|
```
|
||||||
|
|
||||||
|
## Development
|
||||||
|
|
||||||
|
You need to install the following packages to build the theme. Check with your distribution for the package names in the repository
|
||||||
|
|
||||||
|
- `sassc`
|
||||||
|
- `inkscape`
|
||||||
|
- `optipng`
|
||||||
|
|
||||||
|
A few important notes to keep in mind
|
||||||
|
|
||||||
|
- `recolor.py` handles all changes that needs to be done to colloid to ensure it generated catppuccin colors. If vinceliuice changes anything in his theme in future, that is where you must change
|
||||||
|
- `var.py` includes all different variables that you can tinker around as per your personal requirements.
|
||||||
|
- `create_theme.py` consists of a wrapper that will recolor the colloid theme, install it as per the args provided and rename it accordingly.
|
||||||
|
|
||||||
## 💝 Thanks to
|
## 💝 Thanks to
|
||||||
|
|
||||||
@@ -123,7 +221,7 @@ In order to theme the GDM theme, install the `gdm-settings` app, select the Catp
|
|||||||
**Contributions**
|
**Contributions**
|
||||||
|
|
||||||
- [rubyowo](https://github.com/rubyowo) - CI and docs
|
- [rubyowo](https://github.com/rubyowo) - CI and docs
|
||||||
- [braheezy](https://github.com/braheezy) - Instructions for the GDM theme
|
- [braheezy](https://github.com/braheezy) - Instructions for the GDM theme.
|
||||||
|
|
||||||
**Previous maintainer(s)**
|
**Previous maintainer(s)**
|
||||||
|
|
||||||
|
134
build.py
134
build.py
@@ -2,7 +2,7 @@
|
|||||||
import os, re, shutil, subprocess, argparse, glob, logging, zipfile
|
import os, re, shutil, subprocess, argparse, glob, logging, zipfile
|
||||||
|
|
||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
from typing import Any, Literal, List
|
from typing import Literal, List
|
||||||
|
|
||||||
from catppuccin import PALETTE
|
from catppuccin import PALETTE
|
||||||
from catppuccin.models import Flavor, Color
|
from catppuccin.models import Flavor, Color
|
||||||
@@ -30,20 +30,6 @@ class Tweaks:
|
|||||||
return ",".join(self.tweaks)
|
return ",".join(self.tweaks)
|
||||||
|
|
||||||
|
|
||||||
@dataclass
|
|
||||||
class Suffix:
|
|
||||||
true_value: str
|
|
||||||
test: Any # callback function
|
|
||||||
false_value: str = ""
|
|
||||||
|
|
||||||
|
|
||||||
IS_DARK = Suffix(true_value="-Dark", test=lambda ctx: ctx.flavor.dark)
|
|
||||||
IS_LIGHT = Suffix(true_value="-Light", test=lambda ctx: not ctx.flavor.dark)
|
|
||||||
IS_WINDOW_NORMAL = Suffix(true_value="-Normal", test=lambda ctx: ctx.tweaks.has('normal'))
|
|
||||||
DARK_LIGHT = Suffix(
|
|
||||||
true_value="-Dark", false_value="-Light", test=lambda ctx: ctx.flavor.dark
|
|
||||||
)
|
|
||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
class BuildContext:
|
class BuildContext:
|
||||||
build_root: str
|
build_root: str
|
||||||
@@ -60,15 +46,26 @@ class BuildContext:
|
|||||||
def build_id(self) -> str:
|
def build_id(self) -> str:
|
||||||
return f"{self.theme_name}-{self.flavor.identifier}-{self.accent.identifier}-{self.size}+{self.tweaks.id() or 'default'}"
|
return f"{self.theme_name}-{self.flavor.identifier}-{self.accent.identifier}-{self.size}+{self.tweaks.id() or 'default'}"
|
||||||
|
|
||||||
def apply_suffix(self, suffix: Suffix) -> str:
|
|
||||||
if suffix.test(self):
|
|
||||||
return suffix.true_value
|
|
||||||
else:
|
|
||||||
return suffix.false_value
|
|
||||||
|
|
||||||
|
|
||||||
def build(ctx: BuildContext):
|
def build(ctx: BuildContext):
|
||||||
|
dark_suffix = ""
|
||||||
|
light_suffix = ""
|
||||||
|
window_suffix = ""
|
||||||
|
scheme_suffix = "-Catppuccin"
|
||||||
|
|
||||||
|
if ctx.tweaks.has("normal"):
|
||||||
|
window_suffix = "-Normal"
|
||||||
|
|
||||||
|
if ctx.flavor == "latte":
|
||||||
|
light_suffix = "-Light"
|
||||||
|
suffix = "-Light"
|
||||||
|
|
||||||
|
if ctx.flavor != "":
|
||||||
|
dark_suffix = "-Dark"
|
||||||
|
suffix = "-Dark"
|
||||||
|
|
||||||
output_dir = ctx.output_dir()
|
output_dir = ctx.output_dir()
|
||||||
|
# [[ -d "${THEME_DIR}" ]] && rm -rf "${THEME_DIR}"
|
||||||
logger.info(f"Building into '{output_dir}'...")
|
logger.info(f"Building into '{output_dir}'...")
|
||||||
|
|
||||||
apply_tweaks(ctx)
|
apply_tweaks(ctx)
|
||||||
@@ -84,7 +81,7 @@ def build(ctx: BuildContext):
|
|||||||
file.write("[X-GNOME-Metatheme]\n")
|
file.write("[X-GNOME-Metatheme]\n")
|
||||||
file.write(f"GtkTheme={ctx.build_id()}\n")
|
file.write(f"GtkTheme={ctx.build_id()}\n")
|
||||||
file.write(f"MetacityTheme={ctx.build_id()}\n")
|
file.write(f"MetacityTheme={ctx.build_id()}\n")
|
||||||
file.write(f"IconTheme=Tela-circle{ctx.apply_suffix(IS_DARK)}\n")
|
file.write(f"IconTheme=Tela-circle{dark_suffix}\n")
|
||||||
file.write(f"CursorTheme={ctx.flavor.name}-cursors\n")
|
file.write(f"CursorTheme={ctx.flavor.name}-cursors\n")
|
||||||
file.write("ButtonLayout=close,minimize,maximize:menu\n")
|
file.write("ButtonLayout=close,minimize,maximize:menu\n")
|
||||||
|
|
||||||
@@ -97,7 +94,7 @@ def build(ctx: BuildContext):
|
|||||||
[
|
[
|
||||||
"sassc",
|
"sassc",
|
||||||
*SASSC_OPT,
|
*SASSC_OPT,
|
||||||
f"{SRC_DIR}/main/gnome-shell/gnome-shell{ctx.apply_suffix(DARK_LIGHT)}.scss",
|
f"{SRC_DIR}/main/gnome-shell/gnome-shell{suffix}.scss",
|
||||||
f"{output_dir}/gnome-shell/gnome-shell.css",
|
f"{output_dir}/gnome-shell/gnome-shell.css",
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
@@ -107,7 +104,7 @@ def build(ctx: BuildContext):
|
|||||||
[
|
[
|
||||||
"sassc",
|
"sassc",
|
||||||
*SASSC_OPT,
|
*SASSC_OPT,
|
||||||
f"{SRC_DIR}/main/gtk-3.0/gtk{ctx.apply_suffix(DARK_LIGHT)}.scss",
|
f"{SRC_DIR}/main/gtk-3.0/gtk{suffix}.scss",
|
||||||
f"{output_dir}/gtk-3.0/gtk.css",
|
f"{output_dir}/gtk-3.0/gtk.css",
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
@@ -115,9 +112,8 @@ def build(ctx: BuildContext):
|
|||||||
[
|
[
|
||||||
"sassc",
|
"sassc",
|
||||||
*SASSC_OPT,
|
*SASSC_OPT,
|
||||||
# NOTE: This uses 'Dark' for the source, but 'dark' for the destination. This is intentional. Do !!NOT!! change it without consultation
|
|
||||||
f"{SRC_DIR}/main/gtk-3.0/gtk-Dark.scss",
|
f"{SRC_DIR}/main/gtk-3.0/gtk-Dark.scss",
|
||||||
f"{output_dir}/gtk-3.0/gtk-dark.css",
|
f"{output_dir}/gtk-3.0/gtk-Dark.css",
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -126,7 +122,7 @@ def build(ctx: BuildContext):
|
|||||||
[
|
[
|
||||||
"sassc",
|
"sassc",
|
||||||
*SASSC_OPT,
|
*SASSC_OPT,
|
||||||
f"{SRC_DIR}/main/gtk-4.0/gtk{ctx.apply_suffix(DARK_LIGHT)}.scss",
|
f"{SRC_DIR}/main/gtk-4.0/gtk{suffix}.scss",
|
||||||
f"{output_dir}/gtk-4.0/gtk.css",
|
f"{output_dir}/gtk-4.0/gtk.css",
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
@@ -134,9 +130,8 @@ def build(ctx: BuildContext):
|
|||||||
[
|
[
|
||||||
"sassc",
|
"sassc",
|
||||||
*SASSC_OPT,
|
*SASSC_OPT,
|
||||||
# NOTE: This uses 'Dark' for the source, but 'dark' for the destination. This is intentional. Do !!NOT!! change it without consultation
|
|
||||||
f"{SRC_DIR}/main/gtk-4.0/gtk-Dark.scss",
|
f"{SRC_DIR}/main/gtk-4.0/gtk-Dark.scss",
|
||||||
f"{output_dir}/gtk-4.0/gtk-dark.css",
|
f"{output_dir}/gtk-4.0/gtk-Dark.css",
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -145,14 +140,22 @@ def build(ctx: BuildContext):
|
|||||||
[
|
[
|
||||||
"sassc",
|
"sassc",
|
||||||
*SASSC_OPT,
|
*SASSC_OPT,
|
||||||
f"{SRC_DIR}/main/cinnamon/cinnamon{ctx.apply_suffix(DARK_LIGHT)}.scss",
|
f"{SRC_DIR}/main/cinnamon/cinnamon{suffix}.scss",
|
||||||
f"{output_dir}/cinnamon/cinnamon.css",
|
f"{output_dir}/cinnamon/cinnamon.css",
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
subprocess.check_call(
|
||||||
|
[
|
||||||
|
"sassc",
|
||||||
|
*SASSC_OPT,
|
||||||
|
f"{SRC_DIR}/main/gtk-4.0/gtk-Dark.scss",
|
||||||
|
f"{output_dir}/gtk-4.0/gtk-Dark.css",
|
||||||
|
]
|
||||||
|
)
|
||||||
|
|
||||||
os.makedirs(f"{output_dir}/metacity-1", exist_ok=True)
|
os.makedirs(f"{output_dir}/metacity-1", exist_ok=True)
|
||||||
shutil.copyfile(
|
shutil.copyfile(
|
||||||
f"{SRC_DIR}/main/metacity-1/metacity-theme-3{ctx.apply_suffix(IS_WINDOW_NORMAL)}.xml",
|
f"{SRC_DIR}/main/metacity-1/metacity-theme-3{window_suffix}.xml",
|
||||||
f"{output_dir}/metacity-1/metacity-theme-3.xml",
|
f"{output_dir}/metacity-1/metacity-theme-3.xml",
|
||||||
)
|
)
|
||||||
# FIXME: Symlinks aren't working as intended
|
# FIXME: Symlinks aren't working as intended
|
||||||
@@ -168,20 +171,20 @@ def build(ctx: BuildContext):
|
|||||||
|
|
||||||
os.makedirs(f"{output_dir}/xfwm4", exist_ok=True)
|
os.makedirs(f"{output_dir}/xfwm4", exist_ok=True)
|
||||||
shutil.copyfile(
|
shutil.copyfile(
|
||||||
f"{SRC_DIR}/main/xfwm4/themerc{ctx.apply_suffix(IS_LIGHT)}",
|
f"{SRC_DIR}/main/xfwm4/themerc{light_suffix}",
|
||||||
f"{output_dir}/xfwm4/themerc",
|
f"{output_dir}/xfwm4/themerc",
|
||||||
)
|
)
|
||||||
|
|
||||||
os.makedirs(f"{output_dir}-hdpi/xfwm4", exist_ok=True)
|
os.makedirs(f"{output_dir}-hdpi/xfwm4", exist_ok=True)
|
||||||
shutil.copyfile(
|
shutil.copyfile(
|
||||||
f"{SRC_DIR}/main/xfwm4/themerc{ctx.apply_suffix(IS_LIGHT)}",
|
f"{SRC_DIR}/main/xfwm4/themerc{light_suffix}",
|
||||||
f"{output_dir}-hdpi/xfwm4/themerc",
|
f"{output_dir}-hdpi/xfwm4/themerc",
|
||||||
)
|
)
|
||||||
subst_text(f"{output_dir}-hdpi/xfwm4/themerc", "button_offset=6", "button_offset=9")
|
subst_text(f"{output_dir}-hdpi/xfwm4/themerc", "button_offset=6", "button_offset=9")
|
||||||
|
|
||||||
os.makedirs(f"{output_dir}-xhdpi/xfwm4", exist_ok=True)
|
os.makedirs(f"{output_dir}-xhdpi/xfwm4", exist_ok=True)
|
||||||
shutil.copyfile(
|
shutil.copyfile(
|
||||||
f"{SRC_DIR}/main/xfwm4/themerc{ctx.apply_suffix(IS_LIGHT)}",
|
f"{SRC_DIR}/main/xfwm4/themerc{light_suffix or ''}",
|
||||||
f"{output_dir}-xhdpi/xfwm4/themerc",
|
f"{output_dir}-xhdpi/xfwm4/themerc",
|
||||||
)
|
)
|
||||||
subst_text(
|
subst_text(
|
||||||
@@ -190,11 +193,11 @@ def build(ctx: BuildContext):
|
|||||||
|
|
||||||
if not ctx.flavor.dark:
|
if not ctx.flavor.dark:
|
||||||
shutil.copytree(
|
shutil.copytree(
|
||||||
f"{SRC_DIR}/main/plank/theme-Light-Catppuccin/", f"{output_dir}/plank"
|
f"{SRC_DIR}/main/plank/theme-Light{scheme_suffix}/", f"{output_dir}/plank"
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
shutil.copytree(
|
shutil.copytree(
|
||||||
f"{SRC_DIR}/main/plank/theme-Dark-Catppuccin/", f"{output_dir}/plank"
|
f"{SRC_DIR}/main/plank/theme-Dark{scheme_suffix}/", f"{output_dir}/plank"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@@ -288,13 +291,31 @@ def apply_tweaks(ctx: BuildContext):
|
|||||||
|
|
||||||
|
|
||||||
def make_assets(ctx: BuildContext):
|
def make_assets(ctx: BuildContext):
|
||||||
|
color_suffix = ""
|
||||||
|
if not ctx.flavor.dark:
|
||||||
|
color_suffix = "-Light"
|
||||||
|
else:
|
||||||
|
color_suffix = "-Dark"
|
||||||
|
|
||||||
|
dark_suffix = ""
|
||||||
|
if ctx.flavor.dark:
|
||||||
|
dark_suffix = "-Dark"
|
||||||
|
|
||||||
|
light_suffix = ""
|
||||||
|
if not ctx.flavor.dark:
|
||||||
|
light_suffix = "-Light"
|
||||||
|
|
||||||
|
window_suffix = ""
|
||||||
|
if ctx.tweaks.has("normal"):
|
||||||
|
window_suffix = "-Normal"
|
||||||
|
|
||||||
output_dir = ctx.output_dir()
|
output_dir = ctx.output_dir()
|
||||||
|
|
||||||
os.makedirs(f"{output_dir}/cinnamon/assets", exist_ok=True)
|
os.makedirs(f"{output_dir}/cinnamon/assets", exist_ok=True)
|
||||||
for file in glob.glob(f"{SRC_DIR}/assets/cinnamon/theme/*.svg"):
|
for file in glob.glob(f"{SRC_DIR}/assets/cinnamon/theme/*.svg"):
|
||||||
shutil.copy(file, f"{output_dir}/cinnamon/assets")
|
shutil.copy(file, f"{output_dir}/cinnamon/assets")
|
||||||
shutil.copy(
|
shutil.copy(
|
||||||
f"{SRC_DIR}/assets/cinnamon/thumbnail{ctx.apply_suffix(DARK_LIGHT)}.svg",
|
f"{SRC_DIR}/assets/cinnamon/thumbnail{color_suffix}.svg",
|
||||||
f"{output_dir}/cinnamon/thumbnail.png",
|
f"{output_dir}/cinnamon/thumbnail.png",
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -313,11 +334,11 @@ def make_assets(ctx: BuildContext):
|
|||||||
dirs_exist_ok=True,
|
dirs_exist_ok=True,
|
||||||
)
|
)
|
||||||
shutil.copyfile(
|
shutil.copyfile(
|
||||||
f"{SRC_DIR}/assets/gtk/thumbnail{ctx.apply_suffix(IS_DARK)}.svg",
|
f"{SRC_DIR}/assets/gtk/thumbnail{dark_suffix}.svg",
|
||||||
f"{output_dir}/gtk-3.0/thumbnail.png",
|
f"{output_dir}/gtk-3.0/thumbnail.png",
|
||||||
)
|
)
|
||||||
shutil.copyfile(
|
shutil.copyfile(
|
||||||
f"{SRC_DIR}/assets/gtk/thumbnail{ctx.apply_suffix(IS_DARK)}.svg",
|
f"{SRC_DIR}/assets/gtk/thumbnail{dark_suffix}.svg",
|
||||||
f"{output_dir}/gtk-4.0/thumbnail.png",
|
f"{output_dir}/gtk-4.0/thumbnail.png",
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -373,23 +394,23 @@ def make_assets(ctx: BuildContext):
|
|||||||
for file in glob.glob(f"{SRC_DIR}/assets/cinnamon/common-assets/*.svg"):
|
for file in glob.glob(f"{SRC_DIR}/assets/cinnamon/common-assets/*.svg"):
|
||||||
shutil.copy(file, f"{output_dir}/cinnamon/assets")
|
shutil.copy(file, f"{output_dir}/cinnamon/assets")
|
||||||
|
|
||||||
for file in glob.glob(f"{SRC_DIR}/assets/cinnamon/assets{ctx.apply_suffix(IS_DARK)}/*.svg"):
|
for file in glob.glob(f"{SRC_DIR}/assets/cinnamon/assets-{dark_suffix}/*.svg"):
|
||||||
shutil.copy(file, f"{output_dir}/cinnamon/assets")
|
shutil.copy(file, f"{output_dir}/cinnamon/assets")
|
||||||
|
|
||||||
for file in glob.glob(f"{SRC_DIR}/assets/gnome-shell/common-assets/*.svg"):
|
for file in glob.glob(f"{SRC_DIR}/assets/gnome-shell/common-assets/*.svg"):
|
||||||
shutil.copy(file, f"{output_dir}/gnome-shell/assets")
|
shutil.copy(file, f"{output_dir}/gnome-shell/assets")
|
||||||
|
|
||||||
for file in glob.glob(f"{SRC_DIR}/assets/gnome-shell/assets{ctx.apply_suffix(IS_DARK)}/*.svg"):
|
for file in glob.glob(f"{SRC_DIR}/assets/gnome-shell/assets-{dark_suffix}/*.svg"):
|
||||||
shutil.copy(file, f"{output_dir}/gnome-shell/assets")
|
shutil.copy(file, f"{output_dir}/gnome-shell/assets")
|
||||||
|
|
||||||
for file in glob.glob(f"{SRC_DIR}/assets/gtk/symbolics/*.svg"):
|
for file in glob.glob(f"{SRC_DIR}/assets/gtk/symbolics/*.svg"):
|
||||||
shutil.copy(file, f"{output_dir}/gtk-3.0/assets")
|
shutil.copy(file, f"{output_dir}/gtk-3.0/assets")
|
||||||
shutil.copy(file, f"{output_dir}/gtk-4.0/assets")
|
shutil.copy(file, f"{output_dir}/gtk-4.0/assets")
|
||||||
|
|
||||||
for file in glob.glob(f"{SRC_DIR}/assets/metacity-1/assets{ctx.apply_suffix(IS_WINDOW_NORMAL)}/*.svg"):
|
for file in glob.glob(f"{SRC_DIR}/assets/metacity-1/assets-{window_suffix}/*.svg"):
|
||||||
shutil.copy(file, f"{output_dir}/metacity-1/assets")
|
shutil.copy(file, f"{output_dir}/metacity-1/assets")
|
||||||
shutil.copy(
|
shutil.copy(
|
||||||
f"{SRC_DIR}/assets/metacity-1/thumbnail{ctx.apply_suffix(IS_DARK)}.png",
|
f"{SRC_DIR}/assets/metacity-1/thumbnail{dark_suffix}.png",
|
||||||
f"{output_dir}/metacity-1/thumbnail.png",
|
f"{output_dir}/metacity-1/thumbnail.png",
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -397,13 +418,13 @@ def make_assets(ctx: BuildContext):
|
|||||||
# {src_dir}/assets/xfwm4/assets{light_suffix}-Catppuccin/
|
# {src_dir}/assets/xfwm4/assets{light_suffix}-Catppuccin/
|
||||||
# where assets-Light-Catppuccin will have latte
|
# where assets-Light-Catppuccin will have latte
|
||||||
# nad assets-Catppuccin will have mocha or something
|
# nad assets-Catppuccin will have mocha or something
|
||||||
for file in glob.glob(f"{SRC_DIR}/assets/xfwm4/assets{ctx.apply_suffix(IS_LIGHT)}/*.png"):
|
for file in glob.glob(f"{SRC_DIR}/assets/xfwm4/assets{light_suffix}/*.png"):
|
||||||
shutil.copy(file, f"{output_dir}/xfwm4")
|
shutil.copy(file, f"{output_dir}/xfwm4")
|
||||||
|
|
||||||
for file in glob.glob(f"{SRC_DIR}/assets/xfwm4/assets{ctx.apply_suffix(IS_LIGHT)}-hdpi/*.png"):
|
for file in glob.glob(f"{SRC_DIR}/assets/xfwm4/assets{light_suffix}-hdpi/*.png"):
|
||||||
shutil.copy(file, f"{output_dir}-hdpi/xfwm4")
|
shutil.copy(file, f"{output_dir}-hdpi/xfwm4")
|
||||||
|
|
||||||
for file in glob.glob(f"{SRC_DIR}/assets/xfwm4/assets{ctx.apply_suffix(IS_LIGHT)}-xhdpi/*.png"):
|
for file in glob.glob(f"{SRC_DIR}/assets/xfwm4/assets{light_suffix}-xhdpi/*.png"):
|
||||||
shutil.copy(file, f"{output_dir}-xhdpi/xfwm4")
|
shutil.copy(file, f"{output_dir}-xhdpi/xfwm4")
|
||||||
|
|
||||||
|
|
||||||
@@ -541,7 +562,7 @@ def parse_args():
|
|||||||
"sapphire",
|
"sapphire",
|
||||||
"blue",
|
"blue",
|
||||||
"lavender",
|
"lavender",
|
||||||
"all",
|
"all"
|
||||||
],
|
],
|
||||||
help="Accent of the theme.",
|
help="Accent of the theme.",
|
||||||
)
|
)
|
||||||
@@ -584,14 +605,13 @@ def parse_args():
|
|||||||
|
|
||||||
return parser.parse_args()
|
return parser.parse_args()
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
args = parse_args()
|
args = parse_args()
|
||||||
if args.patch:
|
if args.patch:
|
||||||
apply_colloid_patches()
|
apply_colloid_patches()
|
||||||
|
|
||||||
palette = getattr(PALETTE, args.flavor)
|
palette = getattr(PALETTE, args.flavor)
|
||||||
accents = [
|
accents=[
|
||||||
"rosewater",
|
"rosewater",
|
||||||
"flamingo",
|
"flamingo",
|
||||||
"pink",
|
"pink",
|
||||||
@@ -608,16 +628,16 @@ def main():
|
|||||||
"lavender",
|
"lavender",
|
||||||
]
|
]
|
||||||
|
|
||||||
if args.accent == "all":
|
if args.accent == 'all':
|
||||||
for accent in accents:
|
for accent in accents:
|
||||||
accent = getattr(palette.colors, accent)
|
accent = getattr(palette.colors, accent)
|
||||||
|
|
||||||
tweaks = Tweaks(tweaks=args.tweaks)
|
tweaks = Tweaks(tweaks=args.tweaks)
|
||||||
|
|
||||||
if args.zip:
|
if args.zip:
|
||||||
output_format = "zip"
|
output_format = 'zip'
|
||||||
else:
|
else:
|
||||||
output_format = "dir"
|
output_format = 'dir'
|
||||||
|
|
||||||
ctx = BuildContext(
|
ctx = BuildContext(
|
||||||
build_root=args.dest,
|
build_root=args.dest,
|
||||||
@@ -626,7 +646,7 @@ def main():
|
|||||||
accent=accent,
|
accent=accent,
|
||||||
size=args.size,
|
size=args.size,
|
||||||
tweaks=tweaks,
|
tweaks=tweaks,
|
||||||
output_format=output_format,
|
output_format=output_format
|
||||||
)
|
)
|
||||||
|
|
||||||
tweaks_temp()
|
tweaks_temp()
|
||||||
@@ -638,9 +658,9 @@ def main():
|
|||||||
tweaks = Tweaks(tweaks=args.tweaks)
|
tweaks = Tweaks(tweaks=args.tweaks)
|
||||||
|
|
||||||
if args.zip:
|
if args.zip:
|
||||||
output_format = "zip"
|
output_format = 'zip'
|
||||||
else:
|
else:
|
||||||
output_format = "dir"
|
output_format = 'dir'
|
||||||
|
|
||||||
ctx = BuildContext(
|
ctx = BuildContext(
|
||||||
build_root=args.dest,
|
build_root=args.dest,
|
||||||
@@ -649,7 +669,7 @@ def main():
|
|||||||
accent=accent,
|
accent=accent,
|
||||||
size=args.size,
|
size=args.size,
|
||||||
tweaks=tweaks,
|
tweaks=tweaks,
|
||||||
output_format=output_format,
|
output_format=output_format
|
||||||
)
|
)
|
||||||
|
|
||||||
logger.info("Building temp tweaks file")
|
logger.info("Building temp tweaks file")
|
||||||
@@ -664,4 +684,4 @@ def main():
|
|||||||
try:
|
try:
|
||||||
main()
|
main()
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.error("Something went wrong when building the theme:", exc_info=e)
|
logger.error("Something went wrong when installing the theme:", exc_info=e)
|
||||||
|
2
colloid
2
colloid
Submodule colloid updated: 1a13048ea1...1cf28eac20
41
flake.lock
generated
41
flake.lock
generated
@@ -1,25 +1,58 @@
|
|||||||
{
|
{
|
||||||
"nodes": {
|
"nodes": {
|
||||||
|
"flake-utils": {
|
||||||
|
"inputs": {
|
||||||
|
"systems": "systems"
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1710146030,
|
||||||
|
"narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "flake-utils",
|
||||||
|
"rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "flake-utils",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1715961556,
|
"lastModified": 1714495772,
|
||||||
"narHash": "sha256-+NpbZRCRisUHKQJZF3CT+xn14ZZQO+KjxIIanH3Pvn4=",
|
"narHash": "sha256-BVkhvsIatul5lXMrnPvgKkpxL3zZGQlPbTgDlFJiYCo=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "4a6b83b05df1a8bd7d99095ec4b4d271f2956b64",
|
"rev": "c82cda9c0600a2785cda8e60962bcc9cc86862db",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"ref": "nixos-unstable",
|
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"root": {
|
"root": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
|
"flake-utils": "flake-utils",
|
||||||
"nixpkgs": "nixpkgs"
|
"nixpkgs": "nixpkgs"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"systems": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1681028828,
|
||||||
|
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||||
|
"owner": "nix-systems",
|
||||||
|
"repo": "default",
|
||||||
|
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nix-systems",
|
||||||
|
"repo": "default",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"root": "root",
|
"root": "root",
|
||||||
|
29
flake.nix
29
flake.nix
@@ -1,18 +1,17 @@
|
|||||||
{
|
{
|
||||||
inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
inputs = {
|
||||||
|
nixpkgs.url = "github:nixos/nixpkgs";
|
||||||
|
flake-utils.url = "github:numtide/flake-utils";
|
||||||
|
};
|
||||||
|
|
||||||
outputs =
|
outputs = { self, nixpkgs, flake-utils, ... }:
|
||||||
{ nixpkgs, ... }:
|
flake-utils.lib.eachDefaultSystem (system:
|
||||||
let
|
let
|
||||||
forAllSystems =
|
pkgs = import nixpkgs { inherit system; };
|
||||||
function:
|
in
|
||||||
nixpkgs.lib.genAttrs nixpkgs.lib.systems.flakeExposed (
|
{
|
||||||
system: function nixpkgs.legacyPackages.${system}
|
devShells.default = import ./shell.nix { inherit pkgs; };
|
||||||
);
|
}
|
||||||
in
|
);
|
||||||
{
|
|
||||||
devShells = forAllSystems (pkgs: {
|
|
||||||
default = pkgs.callPackage ./shell.nix { };
|
|
||||||
});
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
147
install.py
147
install.py
@@ -1,147 +0,0 @@
|
|||||||
#!/usr/bin/env python3
|
|
||||||
|
|
||||||
import os, zipfile, argparse, logging, io
|
|
||||||
from pathlib import Path
|
|
||||||
from dataclasses import dataclass
|
|
||||||
from urllib.request import urlopen, Request
|
|
||||||
|
|
||||||
logger = logging.getLogger("catppuccin-gtk")
|
|
||||||
logger.setLevel(logging.DEBUG)
|
|
||||||
ch = logging.StreamHandler()
|
|
||||||
formatter = logging.Formatter("[%(name)s] [%(levelname)s] - %(message)s")
|
|
||||||
ch.setFormatter(formatter)
|
|
||||||
logger.addHandler(ch)
|
|
||||||
|
|
||||||
|
|
||||||
@dataclass
|
|
||||||
class InstallContext:
|
|
||||||
flavor: str
|
|
||||||
accent: str
|
|
||||||
dest: Path
|
|
||||||
link: bool
|
|
||||||
|
|
||||||
|
|
||||||
def parse_args():
|
|
||||||
parser = argparse.ArgumentParser()
|
|
||||||
parser.add_argument(
|
|
||||||
"flavor",
|
|
||||||
type=str,
|
|
||||||
choices=["mocha", "frappe", "macchiato", "latte"],
|
|
||||||
help="Flavor of the theme to apply.",
|
|
||||||
)
|
|
||||||
|
|
||||||
parser.add_argument(
|
|
||||||
"accent",
|
|
||||||
type=str,
|
|
||||||
default="mauve",
|
|
||||||
choices=[
|
|
||||||
"rosewater",
|
|
||||||
"flamingo",
|
|
||||||
"pink",
|
|
||||||
"mauve",
|
|
||||||
"red",
|
|
||||||
"maroon",
|
|
||||||
"peach",
|
|
||||||
"yellow",
|
|
||||||
"green",
|
|
||||||
"teal",
|
|
||||||
"sky",
|
|
||||||
"sapphire",
|
|
||||||
"blue",
|
|
||||||
"lavender",
|
|
||||||
"all",
|
|
||||||
],
|
|
||||||
help="Accent of the theme.",
|
|
||||||
)
|
|
||||||
|
|
||||||
parser.add_argument(
|
|
||||||
"--dest",
|
|
||||||
"-d",
|
|
||||||
type=str,
|
|
||||||
dest="dest",
|
|
||||||
help="Destination of the files.",
|
|
||||||
)
|
|
||||||
|
|
||||||
parser.add_argument(
|
|
||||||
"--link",
|
|
||||||
help="Whether to add symlinks for libadwaita",
|
|
||||||
type=bool,
|
|
||||||
default=False,
|
|
||||||
action=argparse.BooleanOptionalAction,
|
|
||||||
)
|
|
||||||
|
|
||||||
return parser.parse_args()
|
|
||||||
|
|
||||||
|
|
||||||
def build_release_url(ctx: InstallContext) -> str:
|
|
||||||
repo_root = "https://github.com/catppuccin/gtk/releases/download"
|
|
||||||
release = "v1.0.0-alpha"
|
|
||||||
zip_name = f"catppuccin-{ctx.flavor}-{ctx.accent}-standard+default.zip"
|
|
||||||
|
|
||||||
return f"{repo_root}/{release}/{zip_name}"
|
|
||||||
|
|
||||||
|
|
||||||
def install(ctx: InstallContext):
|
|
||||||
url = build_release_url(ctx)
|
|
||||||
build_info = f"""Installation info:
|
|
||||||
flavor: {ctx.flavor}
|
|
||||||
accent: {ctx.accent}
|
|
||||||
dest: {ctx.dest.absolute()}
|
|
||||||
link: {ctx.link}
|
|
||||||
|
|
||||||
remote_url: {url}"""
|
|
||||||
logger.info(build_info)
|
|
||||||
httprequest = Request(url)
|
|
||||||
|
|
||||||
zip_file = None
|
|
||||||
logger.info("Starting download...")
|
|
||||||
with urlopen(httprequest) as response:
|
|
||||||
logger.info(f"Response status: {response.status}")
|
|
||||||
zip_file = zipfile.ZipFile(io.BytesIO(response.read()))
|
|
||||||
logger.info("Download finished, zip is valid")
|
|
||||||
|
|
||||||
logger.info("Verifying download..")
|
|
||||||
first_bad_file = zip_file.testzip()
|
|
||||||
if first_bad_file is not None:
|
|
||||||
logger.error(f'Zip appears to be corrupt, first bad file is "{first_bad_file}"')
|
|
||||||
return
|
|
||||||
logger.info("Download verified")
|
|
||||||
|
|
||||||
logger.info("Extracting...")
|
|
||||||
zip_file.extractall(ctx.dest)
|
|
||||||
logger.info("Extraction complete")
|
|
||||||
|
|
||||||
if ctx.link:
|
|
||||||
dir_name = (ctx.dest / f"catppuccin-{ctx.flavor}-{ctx.accent}-standard+default" / 'gtk-4.0').absolute()
|
|
||||||
gtk4_dir = (Path(os.path.expanduser('~')) / '.config' / 'gtk-4.0').absolute()
|
|
||||||
os.makedirs(gtk4_dir, exist_ok=True)
|
|
||||||
|
|
||||||
logger.info("Adding symlinks for libadwaita")
|
|
||||||
logger.info(f'Root: {dir_name}')
|
|
||||||
logger.info(f'Target: {gtk4_dir}')
|
|
||||||
os.symlink(dir_name / 'assets', gtk4_dir / 'assets')
|
|
||||||
os.symlink(dir_name / 'gtk.css', gtk4_dir / 'gtk.css')
|
|
||||||
os.symlink(dir_name / 'gtk-dark.css', gtk4_dir / 'gtk-dark.css')
|
|
||||||
|
|
||||||
|
|
||||||
def main():
|
|
||||||
args = parse_args()
|
|
||||||
dest = Path(os.path.expanduser("~")) / ".local" / "share" / "themes"
|
|
||||||
os.makedirs(dest, exist_ok=True)
|
|
||||||
|
|
||||||
if args.dest:
|
|
||||||
dest = Path(args.dest)
|
|
||||||
|
|
||||||
ctx = InstallContext(
|
|
||||||
flavor=args.flavor, accent=args.accent, dest=dest, link=args.link
|
|
||||||
)
|
|
||||||
|
|
||||||
install(ctx)
|
|
||||||
|
|
||||||
logger.info('Theme installation complete!')
|
|
||||||
|
|
||||||
|
|
||||||
try:
|
|
||||||
main()
|
|
||||||
except Exception as e:
|
|
||||||
logger.error("Something went wrong when installing the theme:", exc_info=e)
|
|
@@ -16,35 +16,35 @@ index 00000000..8a905942
|
|||||||
+
|
+
|
||||||
+// Red
|
+// Red
|
||||||
+$red-light: #{{ palette.red.hex }};
|
+$red-light: #{{ palette.red.hex }};
|
||||||
+$red-dark: #{{ palette.red.hex }};
|
+$red-dark: #{{ palette.red | mod(lightness=30) | get(key="hex") }};
|
||||||
+
|
+
|
||||||
+// Pink
|
+// Pink
|
||||||
+$pink-light: #{{ palette.pink.hex }};
|
+$pink-light: #{{ palette.pink.hex }};
|
||||||
+$pink-dark: #{{ palette.pink.hex }};
|
+$pink-dark: #{{ palette.pink | mod(lightness=30) | get(key="hex") }};
|
||||||
+
|
+
|
||||||
+// Purple
|
+// Purple
|
||||||
+$purple-light: #{{ palette.mauve.hex }};
|
+$purple-light: #{{ palette.mauve.hex }};
|
||||||
+$purple-dark: #{{ palette.mauve.hex }};
|
+$purple-dark: #{{ palette.mauve | mod(lightness=30) | get(key="hex") }};
|
||||||
+
|
+
|
||||||
+// Blue
|
+// Blue
|
||||||
+$blue-light: #{{ palette.blue.hex }};
|
+$blue-light: #{{ palette.blue.hex }};
|
||||||
+$blue-dark: #{{ palette.blue.hex }};
|
+$blue-dark: #{{ palette.blue | mod(lightness=30) | get(key="hex") }};
|
||||||
+
|
+
|
||||||
+// Teal
|
+// Teal
|
||||||
+$teal-light: #{{ palette.teal.hex }};
|
+$teal-light: #{{ palette.teal.hex }};
|
||||||
+$teal-dark: #{{ palette.teal.hex }};
|
+$teal-dark: #{{ palette.teal | mod(lightness=30) | get(key="hex") }};
|
||||||
+
|
+
|
||||||
+// Green
|
+// Green
|
||||||
+$green-light: #{{ palette.green.hex }};
|
+$green-light: #{{ palette.green.hex }};
|
||||||
+$green-dark: #{{ palette.green.hex }};
|
+$green-dark: #{{ palette.green | mod(lightness=30) | get(key="hex") }};
|
||||||
+
|
+
|
||||||
+// Yellow
|
+// Yellow
|
||||||
+$yellow-light: #{{ palette.yellow.hex }};
|
+$yellow-light: #{{ palette.yellow.hex }};
|
||||||
+$yellow-dark: #{{ palette.yellow.hex }};
|
+$yellow-dark: #{{ palette.yellow | mod(lightness=30) | get(key="hex") }};
|
||||||
+
|
+
|
||||||
+// Orange
|
+// Orange
|
||||||
+$orange-light: #{{ palette.peach.hex }};
|
+$orange-light: #{{ palette.peach.hex }};
|
||||||
+$orange-dark: #{{ palette.peach.hex }};
|
+$orange-dark: #{{ palette.peach | mod(lightness=30) | get(key="hex") }};
|
||||||
+
|
+
|
||||||
+// Grey
|
+// Grey
|
||||||
+$grey-050: #{{ palette.text.hex }};
|
+$grey-050: #{{ palette.text.hex }};
|
||||||
|
@@ -8,35 +8,35 @@ index 00000000..8a905942
|
|||||||
+
|
+
|
||||||
+// Red
|
+// Red
|
||||||
+$red-light: #e78284;
|
+$red-light: #e78284;
|
||||||
+$red-dark: #e78284;
|
+$red-dark: #81191b;
|
||||||
+
|
+
|
||||||
+// Pink
|
+// Pink
|
||||||
+$pink-light: #f4b8e4;
|
+$pink-light: #f4b8e4;
|
||||||
+$pink-dark: #f4b8e4;
|
+$pink-dark: #851567;
|
||||||
+
|
+
|
||||||
+// Purple
|
+// Purple
|
||||||
+$purple-light: #ca9ee6;
|
+$purple-light: #ca9ee6;
|
||||||
+$purple-dark: #ca9ee6;
|
+$purple-dark: #58207a;
|
||||||
+
|
+
|
||||||
+// Blue
|
+// Blue
|
||||||
+$blue-light: #8caaee;
|
+$blue-light: #8caaee;
|
||||||
+$blue-dark: #8caaee;
|
+$blue-dark: #143686;
|
||||||
+
|
+
|
||||||
+// Teal
|
+// Teal
|
||||||
+$teal-light: #81c8be;
|
+$teal-light: #81c8be;
|
||||||
+$teal-dark: #81c8be;
|
+$teal-dark: #2f6b63;
|
||||||
+
|
+
|
||||||
+// Green
|
+// Green
|
||||||
+$green-light: #a6d189;
|
+$green-light: #a6d189;
|
||||||
+$green-dark: #a6d189;
|
+$green-dark: #466f2b;
|
||||||
+
|
+
|
||||||
+// Yellow
|
+// Yellow
|
||||||
+$yellow-light: #e5c890;
|
+$yellow-light: #e5c890;
|
||||||
+$yellow-dark: #e5c890;
|
+$yellow-dark: #7d5d1d;
|
||||||
+
|
+
|
||||||
+// Orange
|
+// Orange
|
||||||
+$orange-light: #ef9f76;
|
+$orange-light: #ef9f76;
|
||||||
+$orange-dark: #ef9f76;
|
+$orange-dark: #8a3910;
|
||||||
+
|
+
|
||||||
+// Grey
|
+// Grey
|
||||||
+$grey-050: #c6d0f5;
|
+$grey-050: #c6d0f5;
|
||||||
|
@@ -8,35 +8,35 @@ index 00000000..8a905942
|
|||||||
+
|
+
|
||||||
+// Red
|
+// Red
|
||||||
+$red-light: #d20f39;
|
+$red-light: #d20f39;
|
||||||
+$red-dark: #d20f39;
|
+$red-dark: #900a27;
|
||||||
+
|
+
|
||||||
+// Pink
|
+// Pink
|
||||||
+$pink-light: #ea76cb;
|
+$pink-light: #ea76cb;
|
||||||
+$pink-dark: #ea76cb;
|
+$pink-dark: #851567;
|
||||||
+
|
+
|
||||||
+// Purple
|
+// Purple
|
||||||
+$purple-light: #8839ef;
|
+$purple-light: #8839ef;
|
||||||
+$purple-dark: #8839ef;
|
+$purple-dark: #440b8f;
|
||||||
+
|
+
|
||||||
+// Blue
|
+// Blue
|
||||||
+$blue-light: #1e66f5;
|
+$blue-light: #1e66f5;
|
||||||
+$blue-dark: #1e66f5;
|
+$blue-dark: #073693;
|
||||||
+
|
+
|
||||||
+// Teal
|
+// Teal
|
||||||
+$teal-light: #179299;
|
+$teal-light: #179299;
|
||||||
+$teal-dark: #179299;
|
+$teal-dark: #148086;
|
||||||
+
|
+
|
||||||
+// Green
|
+// Green
|
||||||
+$green-light: #40a02b;
|
+$green-light: #40a02b;
|
||||||
+$green-dark: #40a02b;
|
+$green-dark: #317921;
|
||||||
+
|
+
|
||||||
+// Yellow
|
+// Yellow
|
||||||
+$yellow-light: #df8e1d;
|
+$yellow-light: #df8e1d;
|
||||||
+$yellow-dark: #df8e1d;
|
+$yellow-dark: #885712;
|
||||||
+
|
+
|
||||||
+// Orange
|
+// Orange
|
||||||
+$orange-light: #fe640b;
|
+$orange-light: #fe640b;
|
||||||
+$orange-dark: #fe640b;
|
+$orange-dark: #993901;
|
||||||
+
|
+
|
||||||
+// Grey
|
+// Grey
|
||||||
+$grey-050: #4c4f69;
|
+$grey-050: #4c4f69;
|
||||||
|
@@ -8,35 +8,35 @@ index 00000000..8a905942
|
|||||||
+
|
+
|
||||||
+// Red
|
+// Red
|
||||||
+$red-light: #ed8796;
|
+$red-light: #ed8796;
|
||||||
+$red-dark: #ed8796;
|
+$red-dark: #861425;
|
||||||
+
|
+
|
||||||
+// Pink
|
+// Pink
|
||||||
+$pink-light: #f5bde6;
|
+$pink-light: #f5bde6;
|
||||||
+$pink-dark: #f5bde6;
|
+$pink-dark: #861467;
|
||||||
+
|
+
|
||||||
+// Purple
|
+// Purple
|
||||||
+$purple-light: #c6a0f6;
|
+$purple-light: #c6a0f6;
|
||||||
+$purple-dark: #c6a0f6;
|
+$purple-dark: #470d8d;
|
||||||
+
|
+
|
||||||
+// Blue
|
+// Blue
|
||||||
+$blue-light: #8aadf4;
|
+$blue-light: #8aadf4;
|
||||||
+$blue-dark: #8aadf4;
|
+$blue-dark: #0d388d;
|
||||||
+
|
+
|
||||||
+// Teal
|
+// Teal
|
||||||
+$teal-light: #8bd5ca;
|
+$teal-light: #8bd5ca;
|
||||||
+$teal-dark: #8bd5ca;
|
+$teal-dark: #297166;
|
||||||
+
|
+
|
||||||
+// Green
|
+// Green
|
||||||
+$green-light: #a6da95;
|
+$green-light: #a6da95;
|
||||||
+$green-dark: #a6da95;
|
+$green-dark: #3a7228;
|
||||||
+
|
+
|
||||||
+// Yellow
|
+// Yellow
|
||||||
+$yellow-light: #eed49f;
|
+$yellow-light: #eed49f;
|
||||||
+$yellow-dark: #eed49f;
|
+$yellow-dark: #835f17;
|
||||||
+
|
+
|
||||||
+// Orange
|
+// Orange
|
||||||
+$orange-light: #f5a97f;
|
+$orange-light: #f5a97f;
|
||||||
+$orange-dark: #f5a97f;
|
+$orange-dark: #8f390b;
|
||||||
+
|
+
|
||||||
+// Grey
|
+// Grey
|
||||||
+$grey-050: #cad3f5;
|
+$grey-050: #cad3f5;
|
||||||
|
@@ -8,35 +8,35 @@ index 00000000..8a905942
|
|||||||
+
|
+
|
||||||
+// Red
|
+// Red
|
||||||
+$red-light: #f38ba8;
|
+$red-light: #f38ba8;
|
||||||
+$red-dark: #f38ba8;
|
+$red-dark: #8c0e32;
|
||||||
+
|
+
|
||||||
+// Pink
|
+// Pink
|
||||||
+$pink-light: #f5c2e7;
|
+$pink-light: #f5c2e7;
|
||||||
+$pink-dark: #f5c2e7;
|
+$pink-dark: #841667;
|
||||||
+
|
+
|
||||||
+// Purple
|
+// Purple
|
||||||
+$purple-light: #cba6f7;
|
+$purple-light: #cba6f7;
|
||||||
+$purple-dark: #cba6f7;
|
+$purple-dark: #470d8d;
|
||||||
+
|
+
|
||||||
+// Blue
|
+// Blue
|
||||||
+$blue-light: #89b4fa;
|
+$blue-light: #89b4fa;
|
||||||
+$blue-dark: #89b4fa;
|
+$blue-dark: #063d94;
|
||||||
+
|
+
|
||||||
+// Teal
|
+// Teal
|
||||||
+$teal-light: #94e2d5;
|
+$teal-light: #94e2d5;
|
||||||
+$teal-dark: #94e2d5;
|
+$teal-dark: #21796a;
|
||||||
+
|
+
|
||||||
+// Green
|
+// Green
|
||||||
+$green-light: #a6e3a1;
|
+$green-light: #a6e3a1;
|
||||||
+$green-dark: #a6e3a1;
|
+$green-dark: #2a7723;
|
||||||
+
|
+
|
||||||
+// Yellow
|
+// Yellow
|
||||||
+$yellow-light: #f9e2af;
|
+$yellow-light: #f9e2af;
|
||||||
+$yellow-dark: #f9e2af;
|
+$yellow-dark: #8f650b;
|
||||||
+
|
+
|
||||||
+// Orange
|
+// Orange
|
||||||
+$orange-light: #fab387;
|
+$orange-light: #fab387;
|
||||||
+$orange-dark: #fab387;
|
+$orange-dark: #943c06;
|
||||||
+
|
+
|
||||||
+// Grey
|
+// Grey
|
||||||
+$grey-050: #cdd6f4;
|
+$grey-050: #cdd6f4;
|
||||||
|
Reference in New Issue
Block a user