Compare commits

...

24 Commits

Author SHA1 Message Date
Isabel
fb3ceb6211 chore: update colloid (#182) 2024-05-19 17:52:42 +01:00
Isabel
4b73517739 refactor: nix flake (#180) 2024-05-19 17:51:50 +01:00
Hammy
0c3e8817da build: add nix shell (#176) 2024-04-30 21:08:39 +01:00
Hammy
baecd17698 docs(issue_templates): use issue forms (#175) 2024-04-30 20:25:27 +01:00
Isabel
877e75568c docs(README): add info for using catppuccin/nix (#174) 2024-04-30 19:44:32 +01:00
Hammy
b353190bef ci(release): update action versions and set draft (#173) 2024-04-30 19:01:28 +01:00
Minh Hieu
558953cdd2 fix(status_bar): correctly apply latte colours (#166)
This commit removes the hardcoded string "latte"
and fixes latte from not properly applying
to the status bar.

---------

Co-authored-by: Isabel <isabel@isabelroses.com>
2024-04-30 18:37:42 +01:00
Isabel
9e82be620c docs(issue_template): remote outdated comment (#172) 2024-04-30 17:55:05 +01:00
Yomi Ikuru
662a18a2d6 docs(README): update Nix home-manager example (#170) 2024-04-30 17:48:45 +01:00
Pranav Nedungadi
9da440ced6 Merge pull request #169 from OscarM3615/main
chore(colloid): update submodule
2024-04-20 08:04:14 +05:30
Óscar Miranda
42abad4561 chore(colloid): update submodule 2024-04-17 12:12:51 -06:00
Himanshu
edef76faba chore: update colloid submodule 2024-04-06 20:44:16 +05:30
te_hieuhm1
e7314059e2 chores: update colloid 2024-04-06 15:05:49 +07:00
Himanshu
355e12387f fix(install): fix catppuccin python in install script 2024-04-01 23:40:14 +05:30
Himanshu
5b6c477850 chore: update colloid submodule
chore: update colloid submodule
2024-04-01 23:27:44 +05:30
ghostx31
4f4501f83b chore: update colloid submodule 2024-04-01 23:15:54 +05:30
Jonathan Conder
7000de38a1 fix(install): update catppuccin dependency 2024-03-23 09:05:08 +13:00
Alyx
8d9803f089 docs(README.md): update nixos instructions (#146) 2024-03-14 23:36:16 +00:00
Sahil Nihalani
26b0d12b1b docs: add GDM instructions (#21) 2024-02-24 21:28:45 +05:30
rubyowo
5b043b61c6 docs: slimmer warning 2024-02-24 18:43:24 +04:00
rubyowo
3b802c6b03 docs: add gdm warning 2024-02-24 18:39:54 +04:00
rubyowo
939386a30a docs: add GDM instructions
Closes #21.
2024-02-24 18:18:28 +04:00
Mood
e279ceffca docs: add gtk4 symlink instructions for Nix (#151)
Co-authored-by: winston <hey@winston.sh>
2024-02-24 12:51:41 +00:00
backwardspy
c577226e9c fix(install): pin catppuccin to <2.0.0 (#153) 2024-02-20 18:26:22 +01:00
17 changed files with 357 additions and 210 deletions

View File

@@ -1,33 +0,0 @@
---
name: Bug report
about: Create a bug report about the GTK theme.
title: ''
labels: ''
assignees: ''
---
**Describe the bug**
A clear and concise description of what the bug is.
**Mention your distribution and your theme version**
Please mention your Linux distribution and the theme version you've installed.
**Select how you installed the theme**
- [ ] GitHub Releases
- [ ] AUR package
- [ ] Nixpkg
- [ ] Using the python install script <!-- If you installed using the python script, please mention the command that you ran for installation. -->
- [ ] Flatpak
**Symlinked the gtk-4.0 folder?**
Have you symlinked the `gtk-4.0` folder as mentioned in the [README](https://github.com/catppuccin/gtk/blob/e907775723eb68a5628c1bcd718b9d822cea9aee/README.md?plain=1#L85-L93)? **This is not applicable for users who have installed the theme with the Nixpkg.**
**Expected behavior**
A clear and concise description of what you expected to happen.
**Screenshots**
If possible, please share screenshots of the bug you've encountered.
**Additional context**
Please mention any additional context that might be applicable.

53
.github/ISSUE_TEMPLATE/bug.yml vendored Normal file
View File

@@ -0,0 +1,53 @@
name: Bug Report
description: Report your bugs with the theme here!
labels: [bug]
body:
- type: checkboxes
attributes:
label: Is there an existing issue outlining your problem?
description: Please search to see if an issue already exists for your problem.
options:
- label: I have searched the existing issues and they do not solve my problem.
required: true
- type: textarea
attributes:
label: Describe the bug.
description: Also tell us, what do you expect to see?
placeholder: The tabs are darker than they should be...
validations:
required: true
- type: textarea
attributes:
label: Attach screenshots.
description: If applicable, attach screenshots which clearly highlight the bug.
- type: dropdown
id: installation_method
attributes:
label: How did you install the theme?
options:
- GitHub Release
- AUR Package
- catppuccin/nix
- Nixpkgs
- Flatpak
- From source (Python script)
validations:
required: true
- type: checkboxes
attributes:
label: If using GTK4, have you symlinked the "gtk-4.0" folder?
description: "The instructions for symlinking are described in the [README](https://github.com/catppuccin/gtk/tree/877e75568c9bb0d57c7ddda85b246fa17af45e57?tab=readme-ov-file#for-gtk-4-users)."
options:
- label: I have symlinked the `gtk-4.0` folder.
required: false
- type: input
attributes:
label: What GNOME version are you seeing the bug on?
description: "Follow [GNOME's instructions](https://help.gnome.org/users/gnome-help/stable/gnome-version.html.en) to find out what version you are running."
placeholder: "GNOME Version 42.9"
validations:
required: true
- type: textarea
attributes:
label: Any additional comments?
description: Add any information that hasn't been covered in the previous sections!

5
.github/ISSUE_TEMPLATE/config.yml vendored Normal file
View File

@@ -0,0 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: Community Discord
url: https://discord.com/servers/catppuccin-907385605422448742
about: Chat to other community members!

18
.github/ISSUE_TEMPLATE/enhancement.yml vendored Normal file
View File

@@ -0,0 +1,18 @@
name: Enhancement Issue
description: Request improvements to the theme here!
labels: [enhancement]
body:
- type: checkboxes
attributes:
label: Is there an existing issue outlining your improvement?
description: Please search to see if your improvement has already been raised as an issue.
options:
- label: I have searched the existing issues and my improvement has not been raised yet.
required: true
- type: textarea
attributes:
label: What would you like to see added and/or changed?
description: Make sure to mention why you think this is an improvement!
placeholder: I'd like to have an extra configuration option for...
validations:
required: true

18
.github/ISSUE_TEMPLATE/meta.yml vendored Normal file
View File

@@ -0,0 +1,18 @@
name: Meta Issue
description: Raise any issue regarding the repository here!
labels: [meta]
body:
- type: checkboxes
attributes:
label: Is there an existing issue outlining your problem?
description: Please search to see if an issue already exists for your problem.
options:
- label: I have searched the existing issues and they do not solve my problem.
required: true
- type: textarea
attributes:
label: Describe the issue.
description: Bugs should be raised under a [Bug Report](https://github.com/catppuccin/gtk/issues/new?assignees=&labels=bug&template=bug.yml).
placeholder: The README is missing crucial information such as...
validations:
required: true

View File

@@ -1,20 +1,19 @@
name: "GTK theme release"
name: "Release"
on:
on:
push:
tags:
- "*"
- "v*"
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: true
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: 'pip'
@@ -25,6 +24,7 @@ jobs:
- name: Generate themes
run: python ./install.py all -a all --zip -d $PWD/releases --recreate-asset
- name: Add zips to release
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2
with:
draft: true
files: ./releases/*.zip

132
README.md
View File

@@ -23,8 +23,8 @@ This GTK theme is based on the [Colloid](https://github.com/vinceliuice/Colloid-
### Requirements
- GTK `>=3.20`
- `gnome-themes-extra` (or `gnome-themes-standard`)
- GTK `>=3.20`
- `gnome-themes-extra` (or `gnome-themes-standard`)
### Installation
@@ -35,55 +35,47 @@ This GTK theme is based on the [Colloid](https://github.com/vinceliuice/Colloid-
### For Arch Linux users
We have 4 AUR packages for all the 4 flavours of the theme:
- [Latte](https://aur.archlinux.org/packages/catppuccin-gtk-theme-latte)
- [Frappe](https://aur.archlinux.org/packages/catppuccin-gtk-theme-frappe)
- [Macchiato](https://aur.archlinux.org/packages/catppuccin-gtk-theme-macchiato)
- [Mocha](https://aur.archlinux.org/packages/catppuccin-gtk-theme-mocha)
With your favourite AUR helper, install them:
```bash
yay -S catppuccin-gtk-theme-mocha catppuccin-gtk-theme-macchiato catppuccin-gtk-theme-frappe catppuccin-gtk-theme-latte
```
### For Nix users
The [catppuccin-gtk](https://github.com/NixOS/nixpkgs/blob/master/pkgs/data/themes/catppuccin-gtk/default.nix) package in Nixpkgs allows you to specify the accents, size, tweaks and variant (flavour) of the theme by overriding the package.
By default, the variant is `frappe`, the accent is `blue`, the size is `standard`, and no tweaks are enabled. To change them, override the package. A list of valid choices are available in the package definition [here](https://github.com/NixOS/nixpkgs/blob/7ce8e7c4cf90492a631e96bcfe70724104914381/pkgs/data/themes/catppuccin-gtk/default.nix#L16).
Example:
```nix
pkgs.catppuccin-gtk.override {
accents = [ "pink" ]; # You can specify multiple accents here to output multiple themes
size = "compact";
tweaks = [ "rimless" "black" ]; # You can also specify multiple tweaks here
variant = "macchiato";
}
```bash
yay -S catppuccin-gtk-theme-mocha catppuccin-gtk-theme-macchiato catppuccin-gtk-theme-frappe catppuccin-gtk-theme-latte
```
To use it in home-manager:
### For Nix users
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.
```nix
# home.nix
{
pkgs,
...
}: {
{inputs, ...}: {
imports = [inputs.catppuccin.homeManagerModules.catppuccin];
gtk = {
enable = true;
theme = {
name = "Catppuccin-Macchiato-Compact-Pink-Dark";
package = pkgs.catppuccin-gtk.override {
accents = [ "pink" ];
size = "compact";
tweaks = [ "rimless" "black" ];
variant = "macchiato";
};
catppuccin = {
enable = true;
flavor = "mocha";
accent = "pink";
size = "standard";
tweaks = [ "normal" ];
};
};
}
```
> [!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 GTK 4 users
To theme GTK 4 applications you have to manually symlink the `~/.config/gtk-4.0/` to the themes folder. Use the following commands
```bash
mkdir -p "${HOME}/.config/gtk-4.0"
ln -sf "${THEME_DIR}/gtk-4.0/assets" "${HOME}/.config/gtk-4.0/assets"
@@ -94,13 +86,17 @@ 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
```
```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##
```
```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
@@ -108,28 +104,52 @@ ln -sf "${THEME_DIR}/gtk-4.0/gtk-dark.css" "${HOME}/.config/gtk-4.0/gtk-dark.css
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.
- 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`.
> [!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
@@ -137,10 +157,13 @@ virtualenv -p python3 venv # to be created only once and only if you need a vir
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:
```
@@ -159,12 +182,16 @@ Compulsory field Specify color variant(s) [mocha|frappe|macchiato|latte|a
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
```
@@ -172,6 +199,7 @@ 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`
@@ -185,14 +213,18 @@ A few important notes to keep in mind
## 💝 Thanks to
**Current maintainers**
- [npv12](https://github.com/npv12)
- [ghostx31](https://github.com/ghostx31)
- [Syndrizzle](https://github.com/Syndrizzle)
**Contributions**
- [rubyowo](https://github.com/rubyowo) - for working on the build and CI script
- [rubyowo](https://github.com/rubyowo) - CI and docs
- [braheezy](https://github.com/braheezy) - Instructions for the GDM theme.
**Previous maintainer(s)**
- [sadrach-cl](https://github.com/sadrach-cl)
&nbsp;

Submodule colloid updated: a6e500a0ba...1a13048ea1

27
flake.lock generated Normal file
View File

@@ -0,0 +1,27 @@
{
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1715961556,
"narHash": "sha256-+NpbZRCRisUHKQJZF3CT+xn14ZZQO+KjxIIanH3Pvn4=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "4a6b83b05df1a8bd7d99095ec4b4d271f2956b64",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}

18
flake.nix Normal file
View File

@@ -0,0 +1,18 @@
{
inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
outputs =
{ nixpkgs, ... }:
let
forAllSystems =
function:
nixpkgs.lib.genAttrs nixpkgs.lib.systems.flakeExposed (
system: function nixpkgs.legacyPackages.${system}
);
in
{
devShells = forAllSystems (pkgs: {
default = pkgs.callPackage ./shell.nix { };
});
};
}

View File

@@ -9,7 +9,7 @@ import argparse
import os
import subprocess
from scripts.ctp_colors import ctp_colors, get_all_accent
from scripts.ctp_colors import get_all_accent, get_all_flavors
from scripts.create_theme import create_theme
from scripts.var import theme_name, work_dir
@@ -86,12 +86,12 @@ parser.add_argument("--recreate-asset",
args = parser.parse_args()
if "all" in args.flavor:
flavors = ctp_colors.keys()
flavors = get_all_flavors()
else:
flavors = args.flavor
if "all" in args.accent:
accents = get_all_accent().keys()
accents = get_all_accent()
else:
accents = args.accent

View File

@@ -1 +1 @@
catppuccin>=1.1.1
catppuccin>=2.0.0

View File

@@ -1,16 +1,16 @@
from catppuccin import PALETTE
import os
import shutil
import subprocess
from typing import List
from scripts.ctp_colors import ctp_colors
from scripts.patches import recreate_xfwm4_assets
from scripts.recolor import recolor
from scripts.utils import replacetext, zip_multiple_folders
from scripts.var import def_color_map, repo_dir, src_dir, theme_name, work_dir
def create_theme(types: List[str], accents: List[str], dest: str, link: bool = False,
def create_theme(types: List[str], accents: List[str], dest: str, link: bool = False,
name: str = theme_name, size: str = "standard", tweaks=[], zip = False, recreate_assets = False) -> None:
try:
@@ -24,7 +24,7 @@ def create_theme(types: List[str], accents: List[str], dest: str, link: bool = F
for accent in accents:
# Recolor colloid wrt our selection like mocha. latte
recolor(ctp_colors[type], accent)
recolor(getattr(PALETTE, type), accent)
theme_style: str = "light" if type == "latte" else "dark"
install_cmd: str = f"./install.sh -c {theme_style} -s {size} -n {name} -d {dest} -t {def_color_map[accent]}"
if tweaks:

View File

@@ -1,16 +1,11 @@
from catppuccin import Flavour
from catppuccin import PALETTE
import dataclasses
def get_all_flavors():
return [f.name for f in dataclasses.fields(PALETTE)]
ctp_colors = {
"latte": Flavour.latte(),
"mocha": Flavour.mocha(),
"frappe": Flavour.frappe(),
"macchiato": Flavour.macchiato()
}
def get_all_accent():
accent = {}
for key, value in Flavour.latte().__dict__.items():
if key not in ['white', 'black', 'text', 'subtext0', 'subtext1', 'overlay0', 'overlay1', 'overlay2', 'surface0', 'surface1', 'surface2', 'base', 'mantle', 'crust']:
accent[key] = value
return accent
exclude = ['white', 'black', 'text', 'subtext0', 'subtext1', 'overlay0', 'overlay1', 'overlay2', 'surface0', 'surface1', 'surface2', 'base', 'mantle', 'crust']
return [f.name for f in dataclasses.fields(PALETTE.latte.colors) if f.name not in exclude]

View File

@@ -1,69 +1,69 @@
from catppuccin import Flavour
from catppuccin import PALETTE
from .utils import replacetext, replaceAllText
from .var import (def_accent_dark, def_accent_light, def_color_map, src_dir, work_dir)
def recolor_accent(flavor, accent: str = "blue"):
def recolor_accent(colors, accent: str = "blue"):
"""
Recolors the accent color in a file.
flavor:
colors:
The flavor to recolor to. Like mocha, frappe, latte, etc.
accent:
The accent color to replace. Defaults to Blue
"""
print(f"Recoloring all accents")
replaceAllText( # Recolor as per base for dark theme.
work_dir, def_accent_dark[def_color_map[accent]], flavor.__dict__[accent].hex)
work_dir, def_accent_dark[def_color_map[accent]], getattr(colors, accent).hex)
replaceAllText( # Recolor as per accent for light. Hard code it as latte
work_dir, def_accent_light[def_color_map[accent]], Flavour.latte().__dict__[accent].hex)
work_dir, def_accent_light[def_color_map[accent]], getattr(PALETTE.latte.colors, accent).hex)
def recolor_firefox(flavor, accent: str = "blue"):
def recolor_firefox(colors, accent: str = "blue"):
"""
Recolor the custom gnomish firefox to catpuccin color
"""
firefox_color_file_dark = f"{src_dir}/other/firefox/chrome/Colloid/colors/dark.css"
firefox_color_file_light = f"{src_dir}/other/firefox/chrome/Colloid/colors/light.css"
replacetext(firefox_color_file_light, "2e3436", flavor.base.hex)
replacetext(firefox_color_file_light, "fafafa", Flavour.latte().base.hex)
replacetext(firefox_color_file_light, "f2f2f2", flavor.crust.hex)
replacetext(firefox_color_file_light, "303030", Flavour.mocha().base.hex)
replacetext(firefox_color_file_light, "ffffff", flavor.base.hex)
replacetext(firefox_color_file_light, "5b9bf8", flavor.surface0.hex)
replacetext(firefox_color_file_light, "3c84f7", flavor.__dict__[accent].hex)
replacetext(firefox_color_file_light, "dedede", flavor.surface1.hex)
replacetext(firefox_color_file_light, "f0f0f0", flavor.surface0.hex)
replacetext(firefox_color_file_light, "FAFAFA", flavor.surface1.hex)
replacetext(firefox_color_file_light, "fafafa", flavor.surface0.hex)
replacetext(firefox_color_file_light, "323232", flavor.mantle.hex)
replacetext(firefox_color_file_light, "d5d0cc", flavor.subtext1.hex)
replacetext(firefox_color_file_light, "#2e3436", colors.base.hex)
replacetext(firefox_color_file_light, "#fafafa", PALETTE.latte.colors.base.hex)
replacetext(firefox_color_file_light, "#f2f2f2", colors.crust.hex)
replacetext(firefox_color_file_light, "#303030", PALETTE.mocha.colors.base.hex)
replacetext(firefox_color_file_light, "#ffffff", colors.base.hex)
replacetext(firefox_color_file_light, "#5b9bf8", colors.surface0.hex)
replacetext(firefox_color_file_light, "#3c84f7", getattr(colors, accent).hex)
replacetext(firefox_color_file_light, "#dedede", colors.surface1.hex)
replacetext(firefox_color_file_light, "#f0f0f0", colors.surface0.hex)
replacetext(firefox_color_file_light, "#FAFAFA", colors.surface1.hex)
replacetext(firefox_color_file_light, "#fafafa", colors.surface0.hex)
replacetext(firefox_color_file_light, "#323232", colors.mantle.hex)
replacetext(firefox_color_file_light, "#d5d0cc", colors.subtext1.hex)
# Buttons
replacetext(firefox_color_file_light, "fd5f51", flavor.red.hex)
replacetext(firefox_color_file_light, "38c76a", flavor.green.hex)
replacetext(firefox_color_file_light, "fdbe04", flavor.yellow.hex)
replacetext(firefox_color_file_light, "#fd5f51", colors.red.hex)
replacetext(firefox_color_file_light, "#38c76a", colors.green.hex)
replacetext(firefox_color_file_light, "#fdbe04", colors.yellow.hex)
# Dark
replacetext(firefox_color_file_dark, "eeeeee", flavor.base.hex)
replacetext(firefox_color_file_dark, "2c2c2c", Flavour.mocha().base.hex)
replacetext(firefox_color_file_dark, "242424", flavor.crust.hex)
replacetext(firefox_color_file_dark, "ffffff", Flavour.latte().base.hex)
replacetext(firefox_color_file_dark, "383838", flavor.base.hex)
replacetext(firefox_color_file_dark, "3584e4", flavor.surface0.hex)
replacetext(firefox_color_file_dark, "78aeed", flavor.__dict__[accent].hex)
replacetext(firefox_color_file_dark, "363636", flavor.surface1.hex)
replacetext(firefox_color_file_dark, "404040", flavor.surface0.hex)
replacetext(firefox_color_file_dark, "4F4F4F", flavor.surface1.hex)
replacetext(firefox_color_file_dark, "444444", flavor.surface0.hex)
replacetext(firefox_color_file_dark, "323232", flavor.mantle.hex)
replacetext(firefox_color_file_dark, "919191", flavor.subtext1.hex)
replacetext(firefox_color_file_dark, "#eeeeee", colors.base.hex)
replacetext(firefox_color_file_dark, "#2c2c2c", PALETTE.mocha.colors.base.hex)
replacetext(firefox_color_file_dark, "#242424", colors.crust.hex)
replacetext(firefox_color_file_dark, "#ffffff", PALETTE.latte.colors.base.hex)
replacetext(firefox_color_file_dark, "#383838", colors.base.hex)
replacetext(firefox_color_file_dark, "#3584e4", colors.surface0.hex)
replacetext(firefox_color_file_dark, "#78aeed", getattr(colors, accent).hex)
replacetext(firefox_color_file_dark, "#363636", colors.surface1.hex)
replacetext(firefox_color_file_dark, "#404040", colors.surface0.hex)
replacetext(firefox_color_file_dark, "#4F4F4F", colors.surface1.hex)
replacetext(firefox_color_file_dark, "#444444", colors.surface0.hex)
replacetext(firefox_color_file_dark, "#323232", colors.mantle.hex)
replacetext(firefox_color_file_dark, "#919191", colors.subtext1.hex)
# Buttons
replacetext(firefox_color_file_dark, "fd5f51", flavor.red.hex)
replacetext(firefox_color_file_dark, "38c76a", flavor.green.hex)
replacetext(firefox_color_file_dark, "fdbe04", flavor.yellow.hex)
replacetext(firefox_color_file_dark, "#fd5f51", colors.red.hex)
replacetext(firefox_color_file_dark, "#38c76a", colors.green.hex)
replacetext(firefox_color_file_dark, "#fdbe04", colors.yellow.hex)
def recolor(flavor, accent: str):
"""
@@ -71,75 +71,78 @@ def recolor(flavor, accent: str):
"""
print("Recoloring to suit catppuccin theme")
print("Recoloring accents")
recolor_accent(flavor, accent)
colors = flavor.colors
latte_colors = PALETTE.latte.colors
mocha_colors = PALETTE.mocha.colors
recolor_accent(colors, accent)
print("Recoloring firefox")
recolor_firefox(flavor, accent)
recolor_firefox(colors, accent)
print("MOD: Gtkrc.sh")
replacetext(f"{work_dir}/gtkrc.sh", "background_light='#FFFFFF'",
f"background_light='#{Flavour.latte().base.hex}'") # use latte_base for background_light
f"background_light='{latte_colors.base.hex}'") # use latte_base for background_light
replacetext(f"{work_dir}/gtkrc.sh", "titlebar_light='#F2F2F2'",
f"titlebar_light='#{Flavour.latte().crust.hex}'") # use latte_crust for titlebar_light
f"titlebar_light='{latte_colors.crust.hex}'") # use latte_crust for titlebar_light
replacetext(f"{work_dir}/gtkrc.sh",
"titlebar_light='#F2F2F2'", f"titlebar_light='#{Flavour.latte().crust.hex}'")
"titlebar_light='#F2F2F2'", f"titlebar_light='{latte_colors.crust.hex}'")
if flavor == Flavour.latte():
if flavor.name == PALETTE.latte.name:
replacetext(f"{work_dir}/gtkrc.sh", "background_dark='#0F0F0F'",
f"background_dark='#{Flavour.mocha().base.hex}'")
f"background_dark='{mocha_colors.base.hex}'")
replacetext(f"{work_dir}/gtkrc.sh", "background_darker='#121212'",
f"background_darker='#{Flavour.mocha().mantle.hex}'")
f"background_darker='{mocha_colors.mantle.hex}'")
replacetext(f"{work_dir}/gtkrc.sh",
"background_alt='#212121'", f"background_alt='#{Flavour.mocha().crust.hex}'")
"background_alt='#212121'", f"background_alt='{mocha_colors.crust.hex}'")
replacetext(f"{work_dir}/gtkrc.sh", "titlebar_dark='#030303'",
f"titlebar_dark='#{Flavour.mocha().crust.hex}'")
f"titlebar_dark='{mocha_colors.crust.hex}'")
replacetext(f"{work_dir}/gtkrc.sh", "background_dark='#2C2C2C'",
f"background_dark='#{Flavour.mocha().base.hex}'")
f"background_dark='{mocha_colors.base.hex}'")
replacetext(f"{work_dir}/gtkrc.sh", "background_darker='#3C3C3C'",
f"background_darker='#{Flavour.mocha().mantle.hex}'")
f"background_darker='{mocha_colors.mantle.hex}'")
replacetext(f"{work_dir}/gtkrc.sh",
"background_alt='#464646'", f"background_alt='#{Flavour.mocha().crust.hex}'")
"background_alt='#464646'", f"background_alt='{mocha_colors.crust.hex}'")
replacetext(f"{work_dir}/gtkrc.sh",
"titlebar_dark='#242424'", f"titlebar_dark='#{Flavour.mocha().crust.hex}'")
"titlebar_dark='#242424'", f"titlebar_dark='{mocha_colors.crust.hex}'")
else:
replacetext(f"{work_dir}/gtkrc.sh", "background_dark='#0F0F0F'",
f"background_dark='#{flavor.base.hex}'")
f"background_dark='{colors.base.hex}'")
replacetext(f"{work_dir}/gtkrc.sh", "background_darker='#121212'",
f"background_darker='#{flavor.mantle.hex}'")
f"background_darker='{colors.mantle.hex}'")
replacetext(f"{work_dir}/gtkrc.sh",
"background_alt='#212121'", f"background_alt='#{flavor.crust.hex}'")
"background_alt='#212121'", f"background_alt='{colors.crust.hex}'")
replacetext(f"{work_dir}/gtkrc.sh", "titlebar_dark='#030303'",
f"titlebar_dark='#{flavor.crust.hex}'")
f"titlebar_dark='{colors.crust.hex}'")
replacetext(f"{work_dir}/gtkrc.sh", "background_dark='#2C2C2C'",
f"background_dark='#{flavor.base.hex}'")
f"background_dark='{colors.base.hex}'")
replacetext(f"{work_dir}/gtkrc.sh", "background_darker='#3C3C3C'",
f"background_darker='#{flavor.mantle.hex}'")
f"background_darker='{colors.mantle.hex}'")
replacetext(f"{work_dir}/gtkrc.sh",
"background_alt='#464646'", f"background_alt='#{flavor.crust.hex}'")
"background_alt='#464646'", f"background_alt='{colors.crust.hex}'")
replacetext(f"{work_dir}/gtkrc.sh",
"titlebar_dark='#242424'", f"titlebar_dark='#{flavor.crust.hex}'")
"titlebar_dark='#242424'", f"titlebar_dark='{colors.crust.hex}'")
print("Mod SASS Color_Palette_default")
# Greys
if flavor == Flavour.latte(): # Hardcode till someone smarter than me comes along
if flavor.name == PALETTE.latte.name:
replacetext(f"{src_dir}/sass/_color-palette-default.scss",
"grey-050: #FAFAFA", f"grey-050: #{flavor.crust.hex}")
"grey-050: #FAFAFA", f"grey-050: {colors.crust.hex}")
replacetext(f"{src_dir}/sass/_color-palette-default.scss",
"grey-100: #F2F2F2", f"grey-100: #{flavor.mantle.hex}")
"grey-100: #F2F2F2", f"grey-100: {colors.mantle.hex}")
replacetext(f"{src_dir}/sass/_color-palette-default.scss",
"grey-150: #EEEEEE", f"grey-150: #{flavor.base.hex}")
"grey-150: #EEEEEE", f"grey-150: {colors.base.hex}")
replacetext(f"{src_dir}/sass/_color-palette-default.scss",
"grey-200: #DDDDDD", f"grey-200: #{flavor.surface0.hex}") # Surface 0 Late
"grey-200: #DDDDDD", f"grey-200: {colors.surface0.hex}") # Surface 0 Late
replacetext(f"{src_dir}/sass/_color-palette-default.scss",
"grey-250: #CCCCCC", f"grey-250: #{flavor.surface1.hex}") # D = Surface 1 Late
"grey-250: #CCCCCC", f"grey-250: {colors.surface1.hex}") # D = Surface 1 Late
replacetext(f"{src_dir}/sass/_color-palette-default.scss",
"grey-650: #3C3C3C", f"grey-650: #{Flavour.mocha().surface0.hex}") # H $surface $tooltip
"grey-650: #3C3C3C", f"grey-650: {mocha_colors.surface0.hex}") # H $surface $tooltip
replacetext(f"{src_dir}/sass/_color-palette-default.scss", "grey-700: #2C2C2C",
f"grey-700: #{Flavour.mocha().base.hex}") # G $background; $base; titlebar-backdrop; $popover
f"grey-700: {mocha_colors.base.hex}") # G $background; $base; titlebar-backdrop; $popover
replacetext(f"{src_dir}/sass/_color-palette-default.scss",
"grey-750: #242424", f"grey-750: #{Flavour.mocha().crust.hex}") # F $base-alt
"grey-750: #242424", f"grey-750: {mocha_colors.crust.hex}") # F $base-alt
replacetext(f"{src_dir}/sass/_color-palette-default.scss",
"grey-800: #212121", f"grey-800: #{Flavour.mocha().crust.hex}") # E $panel-solid;p
"grey-800: #212121", f"grey-800: {mocha_colors.crust.hex}") # E $panel-solid;p
replacetext(f"{src_dir}/sass/_color-palette-default.scss",
"grey-850: #121212", f"grey-850: #020202") # H Darknes
replacetext(f"{src_dir}/sass/_color-palette-default.scss",
@@ -148,23 +151,23 @@ def recolor(flavor, accent: str):
"grey-950: #030303", f"grey-950: #000000") # F Darknes
else:
replacetext(f"{src_dir}/sass/_color-palette-default.scss",
"grey-050: #FAFAFA", f"grey-050: #{flavor.overlay2.hex}")
"grey-050: #FAFAFA", f"grey-050: {colors.overlay2.hex}")
replacetext(f"{src_dir}/sass/_color-palette-default.scss",
"grey-100: #F2F2F2", f"grey-100: #{flavor.overlay1.hex}")
"grey-100: #F2F2F2", f"grey-100: {colors.overlay1.hex}")
replacetext(f"{src_dir}/sass/_color-palette-default.scss",
"grey-150: #EEEEEE", f"grey-150: #{flavor.overlay0.hex}")
"grey-150: #EEEEEE", f"grey-150: {colors.overlay0.hex}")
replacetext(f"{src_dir}/sass/_color-palette-default.scss",
"grey-200: #DDDDDD", f"grey-200: #{flavor.surface2.hex}") # Surface 0 Late
"grey-200: #DDDDDD", f"grey-200: {colors.surface2.hex}") # Surface 0 Late
replacetext(f"{src_dir}/sass/_color-palette-default.scss",
"grey-250: #CCCCCC", f"grey-250: #{flavor.surface1.hex}") # D = Surface 1 Late
"grey-250: #CCCCCC", f"grey-250: {colors.surface1.hex}") # D = Surface 1 Late
replacetext(f"{src_dir}/sass/_color-palette-default.scss",
"grey-650: #3C3C3C", f"grey-650: #{flavor.surface0.hex}") # H $surface $tooltip
"grey-650: #3C3C3C", f"grey-650: {colors.surface0.hex}") # H $surface $tooltip
replacetext(f"{src_dir}/sass/_color-palette-default.scss", "grey-700: #2C2C2C",
f"grey-700: #{flavor.base.hex}") # G $background; $base; titlebar-backdrop; $popover
f"grey-700: {colors.base.hex}") # G $background; $base; titlebar-backdrop; $popover
replacetext(f"{src_dir}/sass/_color-palette-default.scss",
"grey-750: #242424", f"grey-750: #{flavor.crust.hex}") # F $base-alt
"grey-750: #242424", f"grey-750: {colors.crust.hex}") # F $base-alt
replacetext(f"{src_dir}/sass/_color-palette-default.scss",
"grey-800: #212121", f"grey-800: #{flavor.crust.hex}") # E $panel-solid;p
"grey-800: #212121", f"grey-800: {colors.crust.hex}") # E $panel-solid;p
replacetext(f"{src_dir}/sass/_color-palette-default.scss",
"grey-850: #121212", f"grey-850: #020202") # H Darknes
replacetext(f"{src_dir}/sass/_color-palette-default.scss",
@@ -180,8 +183,8 @@ def recolor(flavor, accent: str):
# Buttons
replacetext(f"{src_dir}/sass/_color-palette-default.scss",
"button-close: #fd5f51", f"button-close: #{flavor.red.hex}")
"button-close: #fd5f51", f"button-close: {colors.red.hex}")
replacetext(f"{src_dir}/sass/_color-palette-default.scss",
"button-max: #38c76a", f"button-max: #{flavor.green.hex}")
"button-max: #38c76a", f"button-max: {colors.green.hex}")
replacetext(f"{src_dir}/sass/_color-palette-default.scss",
"button-min: #fdbe04", f"button-min: #{flavor.yellow.hex}")
"button-min: #fdbe04", f"button-min: {colors.yellow.hex}")

View File

@@ -8,7 +8,7 @@ tmp_dir = f"{repo_dir}/releases"
theme_name = "Catppuccin"
# Map catppuccin colors to colloid ones
# These are mostly unused except for resources for lower gtk versions.
# These are mostly unused except for resources for lower gtk versions.
# These assets are in png format and I am not really interested right now to recolor them using opencv
# Maybe someone more motivated can follow through
def_color_map = {
@@ -28,23 +28,23 @@ def_color_map = {
'lavender': 'default'}
def_accent_light = {
'default': '3c84f7',
'purple': 'AB47BC',
'pink': 'EC407A',
'red': 'E53935',
'orange': 'F57C00',
'yellow': 'FBC02D',
'green': '4CAF50',
'teal': '009688'
'default': '#3c84f7',
'purple': '#AB47BC',
'pink': '#EC407A',
'red': '#E53935',
'orange': '#F57C00',
'yellow': '#FBC02D',
'green': '#4CAF50',
'teal': '#009688'
}
def_accent_dark = {
'default': '5b9bf8',
'purple': 'BA68C8',
'pink': 'F06292',
'red': 'F44336',
'orange': 'FB8C00',
'yellow': 'FFD600',
'green': '66BB6A',
'teal': '4DB6AC'
'default': '#5b9bf8',
'purple': '#BA68C8',
'pink': '#F06292',
'red': '#F44336',
'orange': '#FB8C00',
'yellow': '#FFD600',
'green': '#66BB6A',
'teal': '#4DB6AC'
}

11
shell.nix Normal file
View File

@@ -0,0 +1,11 @@
{
pkgs ? import <nixpkgs> { },
}:
pkgs.mkShell {
name = "dev-shell";
buildInputs = with pkgs; [
python311
python311Packages.catppuccin
sassc
];
}