Compare commits

..

8 Commits

Author SHA1 Message Date
nullishamy
5c3ec52e39 fix: actually apply our accents (#199)
* fix: actually apply our accents

* chore: remove unused patches
2024-05-20 12:54:33 +01:00
nullishamy
084c3acde7 fix: use rc2 in the install script (#201) 2024-05-20 12:40:09 +01:00
Isabel
66c2314f9c fix: argument --accent behaves like the old argument (#200)
* fix: argument --accent behaves like the old argument

* fix: seprate arg for all accents

* fix: logger accurracy

* ci: call correct build arg
2024-05-20 12:33:13 +01:00
Omar
8d8949e96d docs: improve and fix README formatting / style (#197)
Co-authored-by: Willow <42willow@pm.me>
2024-05-20 12:06:42 +01:00
Isabel
89d94d64cb refactor: reduce repeated code (#198) 2024-05-20 11:56:58 +01:00
nullishamy
13f2a344c8 fix: use v1.0.0-rc1 for the install script (#192) 2024-05-20 02:10:54 +01:00
renovate[bot]
63c8fd9dee chore: Configure Renovate (#184) 2024-05-20 01:38:45 +01:00
nullishamy
0fa26adccc docs(README): overhaul with updated information (#187) 2024-05-20 01:18:48 +01:00
7 changed files with 183 additions and 170 deletions

View File

@@ -22,10 +22,10 @@ jobs:
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 mocha -a all --zip -d $PWD/releases && python ./build.py mocha --all-accents --zip -d $PWD/releases &&
python ./build.py macchiato -a all --zip -d $PWD/releases && python ./build.py macchiato --all-accents --zip -d $PWD/releases &&
python ./build.py frappe -a all --zip -d $PWD/releases && python ./build.py frappe --all-accents --zip -d $PWD/releases &&
python ./build.py latte -a all --zip -d $PWD/releases python ./build.py latte --all-accents --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:

20
CONTRIBUTING.md Normal file
View File

@@ -0,0 +1,20 @@
## Development
### Requirements
- All the [requirements for building](#building)
- `whiskers`, optionally, from [catppuccin/toolbox](https://github.com/catppuccin/toolbox/tree/main/whiskers#installation)
### Patching colloid
> [!TIP]
> If you need to change the patches, reset the submodule and rerun the build script.
We patch upstream colloid through a series of `.patch` files, applied through `git apply` once when the build begins.
The patches are located in `./patches/colloid/`.
Once the build script patches the submodule, it will write a file into
`colloid/.patched`, to signal to future invocations that the patches have already been applied.
The palette patches are generated through `whiskers`,
so if you're changing them, they will need regenerated. Simply run `whiskers palette.tera` to rebuild them.
The process for building the theme is [documented in the README](./README.md#building).

152
README.md
View File

@@ -17,78 +17,54 @@
This GTK theme is based on the [Colloid](https://github.com/vinceliuice/Colloid-gtk-theme) theme made by [vinceliuice](https://github.com/vinceliuice) This GTK theme is based on the [Colloid](https://github.com/vinceliuice/Colloid-gtk-theme) theme made by [vinceliuice](https://github.com/vinceliuice)
## Usage ## Installation
### Requirements This GTK theme requires:
- GTK >=3.20 - GTK `>=3.20`
- `python3` - Python 3+
- `gnome-themes-extra` (or `gnome-themes-standard`)
To build the theme, make sure the following packages are installed: ### Automated script
- `sassc`
- `inkscape`
- `optipng`
### Manually We provide a Python script to automate the process of installing the theme:
1. Download and extract the theme zip from the [latest release](https://github.com/catppuccin/gtk/releases/latest/).
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 ```bash
export THEME_DIR="~/.local/share/themes/catppuccin-<flavor>-<accent>-standard+default" curl -LsS "https://raw.githubusercontent.com/catppuccin/gtk/main/install.py" -o install.py
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
In order for Flatpak to access the theme, make sure to run the following command:
```bash
sudo flatpak override --filesystem=$HOME/.local/share/themes
```
Then, run the following command to apply the theme.
```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> python3 install.py <flavor> <accent>
[catppuccin-gtk] [INFO] - Installation info:
flavor: mocha
accent: blue
dest: /home/<user>/.local/share/themes
link: False
remote_url: https://github.com/catppuccin/gtk/releases/download/v1.0.0-alpha/catppuccin-mocha-blue-standard+default.zip
[catppuccin-gtk] [INFO] - Starting download...
[catppuccin-gtk] [INFO] - Response status: 200
[catppuccin-gtk] [INFO] - Download finished, zip is valid
[catppuccin-gtk] [INFO] - Verifying download..
[catppuccin-gtk] [INFO] - Download verified
[catppuccin-gtk] [INFO] - Extracting...
[catppuccin-gtk] [INFO] - Extraction complete
[catppuccin-gtk] [INFO] - Theme installation complete!
``` ```
If you have adwaita installed, make sure to include `--link` in order to add symlinks for it: ### Arch Linux
```
python3 install.py <flavor> <accent> --link
```
Run the command and the gtk theme should be installed!
### AUR With your favourite AUR helper, you can install your flavor of choice:
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-<flavor>
paru -S catppuccin-gtk-theme-<flavor>
``` ```
### Nix ### Nix
We suggest you use [catppuccin/nix](https://github.com/catppuccin/nix). We have created a Nix module ([catppuccin/nix](https://github.com/catppuccin/nix)) for theming apps under Nix, and recommend that you use it.
Alternatively, you can use [catppuccin-gtk](https://github.com/NixOS/nixpkgs/blob/master/pkgs/data/themes/catppuccin-gtk/default.nix) from nixpkgs. You can set up our Nix module for GTK with the following config:
```nix ```nix
{inputs, ...}: { {inputs, ...}: {
imports = [inputs.catppuccin.homeManagerModules.catppuccin]; imports = [inputs.catppuccin.homeManagerModules.catppuccin];
gtk = { gtk = {
enable = true; enable = true;
catppuccin = { catppuccin = {
@@ -103,19 +79,83 @@ 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 with our module, see the [full documentation](https://github.com/catppuccin/nix/blob/main/docs/home-manager-options.md#gtkcatppuccinenable).
### For Other Distros Alternatively, if you are not using our Nix module, you can grab the theme from [nixpkgs/catppuccin-gtk](https://github.com/NixOS/nixpkgs/blob/master/pkgs/data/themes/catppuccin-gtk/default.nix)
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). ### Manual installation
### Theming the GDM Theme If your distro does not package our theme, and the installation script will not work for your use case, you can pull down releases and extract them yourself. You can find the [latest release on GitHub](https://github.com/catppuccin/gtk/releases/latest).
In order to theme the GDM theme, install the `gdm-settings` app, select the Catppuccin theme, and click *Save*.
```bash
cd ~/.local/share/themes
# Set the root URL
export ROOT_URL="https://https://github.com/catppuccin/gtk/releases/download"
# Change to the tag you want to download
export RELEASE="v1.0.0"
# Change to suite your flavor / accent combination
export FLAVOR="mocha"
export ACCENT="mauve"
curl -LsS "${ROOT_URL}/${RELEASE}/catppuccin-${FLAVOR}-${ACCENT}-standard+default.zip"
# Extract the catppuccin zip file
unzip catppuccin-${FLAVOR}-${ACCENT}-standard+default.zip
# Set the catppuccin theme directory
export THEME_DIR="~/.local/share/themes/catppuccin-${FLAVOR}-${ACCENT}-standard+default"
# Optionally, add support for libadwaita
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"
```
## Building
If our prebuilt offerings do not match your requirements, you will have to build the theme from source.
### Requirements
- Python 3+
- `sassc`, the Sass compiler
> [!WARNING]
> We use a submodule to bring in colloid, the theme this theme is based on. You will need to clone
> with `git clone <url> --recurse-submodules` to bring in the submodule.
To build the theme, simply invoke `build.py`:
```bash
python3 build.py mocha --dest ./build -a rosewater --tweaks rimless
[catppuccin-gtk] [INFO] - Patches seem to be applied, remove "colloid/.patched" to force application (this may fail)
[catppuccin-gtk] [INFO] - Building temp tweaks file
[catppuccin-gtk] [INFO] - Inserting gnome-shell imports
[catppuccin-gtk] [INFO] - Building main theme
[catppuccin-gtk] [INFO] - Build info:
build_root: ./build
theme_name: catppuccin
flavor: mocha
accent: rosewater
size: standard
tweaks: Tweaks(tweaks=['rimless'])
[catppuccin-gtk] [INFO] - Building into './build/catppuccin-mocha-rosewater-standard+rimless'...
[catppuccin-gtk] [INFO] - Main build complete
[catppuccin-gtk] [INFO] - Bundling assets...
[catppuccin-gtk] [INFO] - Asset bundling done
[catppuccin-gtk] [INFO] - Done!
```
You can now find the built theme under `./build`. If you want to package the theme up as a zip instead, pass `--zip` to the build script.
## 💝 Thanks to ## 💝 Thanks to
**Current maintainers** **Current maintainers**
- [nullishamy](https://github.com/nullishamy)
- [npv12](https://github.com/npv12) - [npv12](https://github.com/npv12)
- [ghostx31](https://github.com/ghostx31) - [ghostx31](https://github.com/ghostx31)
- [Syndrizzle](https://github.com/Syndrizzle) - [Syndrizzle](https://github.com/Syndrizzle)

View File

@@ -1,4 +1,4 @@
#! /usr/bin/env python3 #!/usr/bin/env python3
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
@@ -198,7 +198,7 @@ def build(ctx: BuildContext):
) )
def tweaks_temp(): def init_tweaks_temp():
shutil.copyfile(f"{SRC_DIR}/sass/_tweaks.scss", f"{SRC_DIR}/sass/_tweaks-temp.scss") shutil.copyfile(f"{SRC_DIR}/sass/_tweaks.scss", f"{SRC_DIR}/sass/_tweaks-temp.scss")
@@ -262,7 +262,7 @@ def write_tweak(key, default, value):
def apply_tweaks(ctx: BuildContext): def apply_tweaks(ctx: BuildContext):
write_tweak("theme", "'default'", translate_accent(ctx.accent)) write_tweak("theme", "'default'", f"'{translate_accent(ctx.accent)}'")
if ctx.size == "compact": if ctx.size == "compact":
write_tweak("compact", "'false'", "'true'") write_tweak("compact", "'false'", "'true'")
@@ -477,7 +477,6 @@ def apply_colloid_patches():
for patch in [ for patch in [
"plank-dark.patch", "plank-dark.patch",
"plank-light.patch", "plank-light.patch",
"sass-colors.patch",
"sass-palette-frappe.patch", "sass-palette-frappe.patch",
"sass-palette-mocha.patch", "sass-palette-mocha.patch",
"sass-palette-latte.patch", "sass-palette-latte.patch",
@@ -525,7 +524,8 @@ def parse_args():
"-a", "-a",
type=str, type=str,
default="mauve", default="mauve",
dest="accent", nargs='+',
dest="accents",
choices=[ choices=[
"rosewater", "rosewater",
"flamingo", "flamingo",
@@ -541,11 +541,17 @@ def parse_args():
"sapphire", "sapphire",
"blue", "blue",
"lavender", "lavender",
"all",
], ],
help="Accent of the theme.", help="Accent of the theme.",
) )
parser.add_argument(
"--all-accents",
help="Whether to build all accents",
dest="all_accents",
action="store_true",
)
parser.add_argument( parser.add_argument(
"--size", "--size",
"-s", "-s",
@@ -590,7 +596,17 @@ def main():
if args.patch: if args.patch:
apply_colloid_patches() apply_colloid_patches()
if args.zip:
output_format = "zip"
else:
output_format = "dir"
tweaks = Tweaks(tweaks=args.tweaks)
palette = getattr(PALETTE, args.flavor) palette = getattr(PALETTE, args.flavor)
accents = args.accents
if args.all_accents:
accents = [ accents = [
"rosewater", "rosewater",
"flamingo", "flamingo",
@@ -608,7 +624,6 @@ def main():
"lavender", "lavender",
] ]
if args.accent == "all":
for accent in accents: for accent in accents:
accent = getattr(palette.colors, accent) accent = getattr(palette.colors, accent)
@@ -618,7 +633,6 @@ def main():
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,
theme_name=args.name, theme_name=args.name,
@@ -628,38 +642,15 @@ def main():
tweaks=tweaks, tweaks=tweaks,
output_format=output_format, output_format=output_format,
) )
tweaks_temp()
gnome_shell_version()
build_theme(ctx)
logger.info("Done!")
else:
accent = getattr(palette.colors, args.accent)
tweaks = Tweaks(tweaks=args.tweaks)
if args.zip:
output_format = "zip"
else:
output_format = "dir"
ctx = BuildContext(
build_root=args.dest,
theme_name=args.name,
flavor=palette,
accent=accent,
size=args.size,
tweaks=tweaks,
output_format=output_format,
)
logger.info("Building temp tweaks file") logger.info("Building temp tweaks file")
tweaks_temp() init_tweaks_temp()
logger.info("Inserting gnome-shell imports") logger.info("Inserting gnome-shell imports")
gnome_shell_version() gnome_shell_version()
logger.info("Building main theme") logger.info("Building main theme")
build_theme(ctx) build_theme(ctx)
logger.info("Done!") logger.info(f"Completed {palette.identifier} with {accent.identifier}")
logger.info("Done!")
try: try:
main() main()

View File

@@ -75,7 +75,7 @@ def parse_args():
def build_release_url(ctx: InstallContext) -> str: def build_release_url(ctx: InstallContext) -> str:
repo_root = "https://github.com/catppuccin/gtk/releases/download" repo_root = "https://github.com/catppuccin/gtk/releases/download"
release = "v1.0.0-alpha" release = "v1.0.0-rc2"
zip_name = f"catppuccin-{ctx.flavor}-{ctx.accent}-standard+default.zip" zip_name = f"catppuccin-{ctx.flavor}-{ctx.accent}-standard+default.zip"
return f"{repo_root}/{release}/{zip_name}" return f"{repo_root}/{release}/{zip_name}"

View File

@@ -1,47 +0,0 @@
diff --git a/src/sass/_colors.scss b/src/sass/_colors.scss
index e8366fa0..97fa670c 100644
--- a/src/sass/_colors.scss
+++ b/src/sass/_colors.scss
@@ -57,9 +57,8 @@
@else { @return rgba($white, 0.1); }
}
-@function theme($color) {
+@function theme() {
@if ($variant == 'light') {
- @if ($theme == 'default') { @return $default-dark; }
@if ($theme == 'purple') { @return $purple-dark; }
@if ($theme == 'pink') { @return $pink-dark; }
@if ($theme == 'red') { @return $red-dark; }
@@ -68,8 +67,9 @@
@if ($theme == 'green') { @return $green-dark; }
@if ($theme == 'teal') { @return $teal-dark; }
@if ($theme == 'grey') { @return $grey-600; }
+
+ @return $default-dark;
} @else {
- @if ($theme == 'default') { @return $default-light; }
@if ($theme == 'purple') { @return $purple-light; }
@if ($theme == 'pink') { @return $pink-light; }
@if ($theme == 'red') { @return $red-light; }
@@ -78,6 +78,8 @@
@if ($theme == 'green') { @return $green-light; }
@if ($theme == 'teal') { @return $teal-light; }
@if ($theme == 'grey') { @return $grey-200; }
+
+ @return $default-light;
}
}
@@ -113,9 +115,9 @@
// Basic colors
//
-$primary: theme(color);
+$primary: theme();
$drop_target_color: $orange-dark;
-$indicator: theme(color);
+$indicator: theme();
$titlebar-indicator: if($variant == 'dark', currentColor, $primary);
$inverse-indicator: if($theme == 'grey', $white, $primary);
$applet-primary: if($theme == 'grey' and variant == 'light' and $topbar == 'dark', $grey-200, $primary);

9
renovate.json Normal file
View File

@@ -0,0 +1,9 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"config:recommended"
],
"git-submodules": {
"enabled": true
}
}