Compare commits

...

118 Commits

Author SHA1 Message Date
nullishamy
8b54c05ff5 fix: titlebars should be mantle not crust (#238) 2024-05-27 15:09:24 +01:00
nullishamy
03fd2c9b7e fix: xfwm4 assets (#240) 2024-05-27 15:09:02 +01:00
nullishamy
8b459944c4 fix: add build suffix (#241) 2024-05-27 15:04:27 +01:00
nullishamy
124944fc5b docs: architecture docs (#242) 2024-05-27 14:16:28 +01:00
nullishamy
641f692dd8 chore: update install script to rc5 (#233) 2024-05-24 21:30:16 +01:00
nullishamy
a36e8a3b91 fix: allow all accents to be used (#232) 2024-05-24 21:19:52 +01:00
nullishamy
327d02c0ec ci: exit with non zero exit code when a build fails (#231) 2024-05-24 20:04:15 +01:00
Isabel
495589d9f8 fix: patches (#229) 2024-05-24 19:54:48 +01:00
nullishamy
455dd7b403 chore: update install script to rc4 (#227) 2024-05-24 16:20:29 +01:00
Isabel
b40c355ba3 fix(patches): allow to work on windows (#226) 2024-05-24 16:14:30 +01:00
nullishamy
001ba5bf12 feat: reintroduce black tweak as OLED-esque variant (#213) 2024-05-24 16:10:06 +01:00
nullishamy
1c336f20ad chore: issue template (#222) 2024-05-24 15:36:01 +01:00
Omar
14cee4c1f5 docs: flatpak guide (#221)
Co-authored-by: Isabel <isabel@isabelroses.com>
2024-05-24 13:28:08 +01:00
nullishamy
febd32f208 docs: upstreaming procedure (#219)
* docs: upstreaming procedure

* docs: math

Co-authored-by: Isabel <isabel@isabelroses.com>

---------

Co-authored-by: Isabel <isabel@isabelroses.com>
2024-05-22 01:31:17 +01:00
nullishamy
663f6c61f8 fix: installation (#210) 2024-05-21 14:22:56 +01:00
nullishamy
b2f3d267e4 docs: add new build reqs in (#208) 2024-05-21 14:22:33 +01:00
nullishamy
e72416ae5e docs: add resources to contributing guide (#211) 2024-05-21 14:22:05 +01:00
nullishamy
87a5f92f4b chore: update install script to rc3 (#207) 2024-05-20 23:14:54 +01:00
nullishamy
b508c0ff2d feat: xfwm4 asset generation (#206) 2024-05-20 23:09:22 +01:00
nullishamy
44be6bb595 ci: build in PRs (#202)
* ci: build in PRs

* ci: improve naming

* ci: upload individual artifacts

* ci: try running when PRs are pushed to

* ci: name

* ci: try individual again

* ci: friendship ended with gha; gitlab ci/cd is my new friend

* feat: introduce --from-artifact opt in install script
2024-05-20 16:34:12 +01:00
nullishamy
6eeda71fb7 fix: disallow 'all' in install.py accent options (#205) 2024-05-20 13:50:02 +01:00
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
nullishamy
9625cc3eb1 refactor: build scripts (#186)
* refactor: build scripts

* ci: remove matrix
2024-05-19 20:48:13 +01:00
nullishamy
d8a7720c1d docs: update readme to support new build system (#183) (#185)
* improve readme

* update readme

* fix some stuff

* fix alot of stuff

* fix alot of stuff (again)

* fixes by duk

* fix: apply suggestions from code review

* fix: apply suggestions from code review



* fixing some stuff

---------

Co-authored-by: Omar <147266582+somerand0mcat@users.noreply.github.com>
2024-05-19 18:45:11 +01:00
nullishamy
4050bab0f1 build: new build system (#178)
* build: start new build system

* fix: keys

* fix: suffixes

* feat: assets

* fix: naming; xfwm4; remove todos

* style: refactor the whole build script

* feat: actually use our palette

* feat: zipping

* ci: adapt to new build system

* ci: whoops

* fix: allow all accents to be generated in 1 task

* ci: don't explode the ci

* fix: allow skipping of patch procedures

* fix: daArKrDaRkdarkdark

* feat: first pass at install script

* fix: use shebang

* fix: use `dark` for gtk css universally
2024-05-19 18:37:46 +01:00
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
ghostx31
76cccfa215 chore: update colloid 2023-11-16 18:42:45 +05:30
ghostx31
9082969c1c docs: remove murrine-engine requirement 2023-10-05 20:12:40 +05:30
Pranav Nedungadi
f3faf6d9da Merge pull request #120 from iruzo/main
docs: add window manager guide
2023-10-05 15:51:12 +05:30
Pranav Nedungadi
761a075ca9 Merge pull request #121 from D3faIt/patch-1
docs: added cd, reworded text in README.md
2023-10-05 15:49:47 +05:30
ghostx31
9849cea54f fix: Gnome 45 issues 2023-10-01 20:13:44 +05:30
Dixon Sean Low Yan Feng
0f516404fd docs(nix): update theme name capitalization again (#122)
This reverts commit eb7ed7ab2c.

f13a2b2 changed the naming convention for the theme names again so that
the theme style (dark or light) is capitalized again. The docs were
updated accordingly for Home Manager.

However, eb7ed7a changed the documentation for Home Manager back to the
non-capitalized names. This was likely because the capitalization change
had not made its way to `nixos-unstable`. The change has now made it to
`nixos-unstable`, so this commit reverts eb7ed7 to reflect the
capitalization.
2023-10-01 14:10:55 +02:00
D3faIt
23a48d8b81 fix README.md
Added `cd` to "using the script" instructions. Reworded some text
2023-09-23 13:39:28 +02:00
ruzo
03376d1003 docs: add window manager guide 2023-09-16 17:30:34 +02:00
Pranav
5255501faf chore: script: update colloid
Signed-off-by: Pranav <npv12@iitbbs.ac.in>
2023-09-07 00:41:39 +05:30
Himanshu
1897b09f23 fix(docs): theme name in README (home-manager)
fix theme name in readme
2023-08-13 11:35:13 +05:30
éclairevoyant
eb7ed7ab2c fix theme name in readme 2023-08-13 00:28:02 -04:00
Pranav Nedungadi
831a06c672 Merge pull request #104 from bagelwaffle/patch-1
docs: minor fixes
2023-08-04 20:18:17 +05:30
Pranav
f13a2b2e08 Revert "fix: do not capitalise theme style"
* stay inline with upstream

This reverts commit 3fc72208de.

Signed-off-by: Pranav <npv12@iitbbs.ac.in>
2023-08-04 14:26:44 +05:30
Pranav
a40e058320 chore: update colloid version
Signed-off-by: Pranav <npv12@iitbbs.ac.in>
2023-08-04 14:25:34 +05:30
Pranav Nedungadi
d6d1e951e4 Merge pull request #105 from avanderbergh/issue99
Use correct for `theme_style` case in Readme.md
2023-07-04 13:33:18 +05:30
Adriaan van der Bergh
59a26aa3cd Fix readme 2023-07-04 07:32:14 +00:00
Bagel Waffle
dbcaeb738f docs: small fixes 2023-07-01 16:09:29 -07:00
Bagel Waffle
50203b06bb docs: fixed capitalization of "It's FOSS" 2023-07-01 15:54:32 -07:00
Pranav
329e522c08 chore: update colloid
Signed-off-by: Pranav <npv12@iitbbs.ac.in>
2023-06-21 19:16:02 +05:30
Pranav
3fc72208de fix: do not capitalise theme style
fixes #100

Signed-off-by: Pranav <npv12@iitbbs.ac.in>
2023-06-21 19:15:34 +05:30
Pranav
b75165df4d feat: Enable option for float panel
Signed-off-by: Pranav <npv12@iitbbs.ac.in>
2023-06-03 08:42:16 +05:30
Pranav
1a5f20809a chore: update colloid 2023-06-03 08:41:01 +05:30
Pranav
5c05af916a chore: update colloid
Signed-off-by: Pranav <npv12@iitbbs.ac.in>
2023-05-21 15:03:46 +05:30
spooky
19d4e9cd5b docs(README): fix install instructions for --link 2023-05-02 15:43:46 +05:30
bronsen
d5f542f484 docs(README): fix long option for linking gtk-4.0
The install script actually uses `--link` as long option for linking
gtk-4.0 themes.
2023-05-02 10:59:45 +02:00
Pranav
0997e92071 chore: update index.theme theme name correctly
fixes #90

Signed-off-by: Pranav <npv12@iitbbs.ac.in>
2023-04-16 16:25:50 +05:30
Pranav
d11e6465bd chore: update colloid
Signed-off-by: Pranav <npv12@iitbbs.ac.in>
2023-04-14 15:59:42 +05:30
Pranav
6c350cc3eb chore: update colloid
fixes #81

Signed-off-by: Pranav <npv12@iitbbs.ac.in>
2023-04-12 10:56:41 +05:30
Pranav
7c470654a7 workflow: recreate assets
Signed-off-by: Pranav <npv12@iitbbs.ac.in>
2023-03-26 17:03:39 +05:30
Pranav
50e9e0120b fix: script: do not fail if supplementing a theme name
fixes #76

Signed-off-by: Pranav <npv12@iitbbs.ac.in>
2023-03-26 16:55:15 +05:30
Pranav
f2b5321c23 fix: Do not generate assets for all types.
Signed-off-by: Pranav <npv12@iitbbs.ac.in>
2023-03-26 16:43:20 +05:30
ghostx31
ade94e3bd6 docs(README): add package dependencies in dev guide 2023-03-26 12:39:11 +05:30
ghostx31
a9cbb4cf93 ci: added dependencies for xfwm 2023-03-26 12:33:27 +05:30
spooky
9e75eac1e5 fix: fix xfwm4 issues 2023-03-26 11:08:08 +05:30
ghostx31
01ea28f3a3 chore: update branches 2023-03-26 10:33:29 +05:30
ghostx31
538067923b chore: update colloid submodule 2023-03-26 10:32:20 +05:30
Pranav
a53263bad2 chore: update colloid submodule
Signed-off-by: Pranav <npv12@iitbbs.ac.in>
2023-03-16 09:46:13 +05:30
ghostx31
45df79e72c chore(bug issue template): change nix package to nixpkg 2023-03-04 14:01:38 +05:30
spooky
ed3abe04f8 feat: add issue template 2023-03-04 13:51:28 +05:30
spooky
e907775723 docs: improve nix instructions
docs: improve nix instructions
2023-02-24 22:26:15 +05:30
Dixon Sean Low Yan Feng
c79e453e62 docs: improve nix instructions
Documents the other configurable options and updates the example accordingly.
2023-02-24 01:48:26 +08:00
Pranav
68167565f7 feat: introduce assets for xfwm4.
* patches assets were taken from ddf996b0a4

Signed-off-by: Pranav <npv12@iitbbs.ac.in>
2023-02-22 20:23:53 +05:30
Pranav
7e40f9c9ab chore: update colloid
Signed-off-by: Pranav <npv12@iitbbs.ac.in>
2023-02-22 19:33:32 +05:30
Pranav
41d54ae759 chore: update colloid
Signed-off-by: Pranav <npv12@iitbbs.ac.in>
2023-02-08 00:05:26 +05:30
rubyowo
382e960588 docs: nix instructions (#72) 2023-01-21 09:07:03 +01:00
Pranav
8702e3c5ae feat: start themeing firefox sections as well
Signed-off-by: Pranav <npv12@iitbbs.ac.in>
2023-01-18 08:27:40 +05:30
Pranav
8a1f11a408 chore: hardcode dark colors with mocha for latte themes
* fixes #67
2023-01-18 07:58:27 +05:30
Pranav
0b7ee02c92 chore: update colloid
Signed-off-by: Pranav <npv12@iitbbs.ac.in>
2023-01-16 14:37:09 +05:30
Pranav
19727f8a6c chore: Make the close button black
Signed-off-by: Pranav <npv12@iitbbs.ac.in>
2023-01-08 19:37:00 +05:30
Pranav
7e06524be9 chore: fix workflow
Signed-off-by: Pranav <npv12@iitbbs.ac.in>
2023-01-08 19:20:10 +05:30
Pranav
d8b4681809 chore: automatically clone gitmodule if colloid is empty
Signed-off-by: Pranav <npv12@iitbbs.ac.in>
2023-01-08 18:59:16 +05:30
Pranav
f3a1ad61f4 chore: update colloid
Signed-off-by: Pranav <npv12@iitbbs.ac.in>
2023-01-08 18:53:01 +05:30
Pranav
7806c32e67 fix: replace all instances in case of accents
Signed-off-by: Pranav <npv12@iitbbs.ac.in>
2022-12-25 09:28:03 +05:30
Pranav
81535cae4f chore: use correct theme dir for gtk if none is provided
Signed-off-by: Pranav <npv12@iitbbs.ac.in>
2022-12-25 05:44:50 +05:30
Pranav
9ec907ae78 chore: rebuild all scss files before install
Signed-off-by: Pranav <npv12@iitbbs.ac.in>
2022-12-18 11:05:36 +05:30
Pranav
1d0546569b fix: Oledpuccin time
* use --tweaks black

Signed-off-by: Pranav <npv12@iitbbs.ac.in>
2022-12-16 21:03:49 +05:30
Pranav
6267569781 chore: update readme to include symlink and various commands 2022-12-16 20:56:21 +05:30
Pranav
44aec3060b fix: update colloid to fix blur in overview
* fixes #62

Signed-off-by: Pranav <npv12@iitbbs.ac.in>
2022-12-15 17:12:00 +05:30
Pranav
2045263fdb chore: update colloid to fix firefox 108
Signed-off-by: Pranav <npv12@iitbbs.ac.in>
2022-12-14 20:28:30 +05:30
spooky
35ae75716d Merge pull request #61 from npv12/main
chore: remove unused assets
2022-12-14 08:12:22 +05:30
Pranav
276a29ece9 chore: remove unused assets
* also fix non existant build.py in README
2022-12-14 08:09:37 +05:30
Himanshu
bdf5c33ef4 docs(README): fix a few grammatical errors 2022-12-13 20:07:50 +05:30
41 changed files with 7918 additions and 5260 deletions

1
.envrc Normal file
View File

@@ -0,0 +1 @@
use flake

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

@@ -0,0 +1,59 @@
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:
- From release (install.py)
- From release (manual installation)
- From source (build.py)
- Nix (nixpkgs / catppuccin/nix)
- AUR package
validations:
required: true
- type: checkboxes
attributes:
label: Are you running the latest release, and if not does the issue persist there?
description: "Our latest release can be found under the [GitHub releases](https://github.com/catppuccin/gtk/releases/latest)"
options:
- label: I am running on the latest release & the issue persists there
required: true
- type: checkboxes
attributes:
label: If using GTK4, have you symlinked the "gtk-4.0" folder?
description: "The instructions for symlinking are described at the bottom of the [Manual Installation guide](https://github.com/catppuccin/gtk/tree/663f6c61f8cf1fcbbeb72110bf6b0a0214755245?tab=readme-ov-file#manual-installation)."
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

35
.github/workflows/build.yml vendored Normal file
View File

@@ -0,0 +1,35 @@
name: "Generate test artifacts"
on:
pull_request:
types: [opened, reopened, synchronize]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true
- uses: actions/setup-python@v5
with:
python-version: "3.11"
cache: "pip"
- name: Install dependencies
run: pip install -r requirements.txt
- name: Install colloid specific dependencies
run: sudo apt update && sudo apt install -y sassc inkscape optipng
- name: Generate themes
run: |
python patches/xfwm4/generate_assets.py
python ./build.py mocha --all-accents --zip -d $PWD/releases &&
python ./build.py macchiato --all-accents --zip -d $PWD/releases &&
python ./build.py frappe --all-accents --zip -d $PWD/releases &&
python ./build.py latte --all-accents --zip -d $PWD/releases
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: '${{ github.sha }}-artifacts'
path: ./releases/*.zip

View File

@@ -1,28 +1,33 @@
name: "GTK theme release"
name: "Mainline release"
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'
python-version: "3.11"
cache: "pip"
- name: Install dependencies
run: pip install -r requirements.txt
- name: Install colloid specific dependencies
run: sudo apt update && sudo apt install -y sassc inkscape optipng
- name: Generate themes
run: python ./install.py all -a all --zip
run: |
python ./build.py mocha --all-accents --zip -d $PWD/releases &&
python ./build.py macchiato --all-accents --zip -d $PWD/releases &&
python ./build.py frappe --all-accents --zip -d $PWD/releases &&
python ./build.py latte --all-accents --zip -d $PWD/releases
- name: Add zips to release
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2
with:
draft: true
files: ./releases/*.zip

7
.gitignore vendored
View File

@@ -2,6 +2,13 @@ pkgs/
*-temp.scss
__pycache__
venv/
.venv
bin/
lib*/
*.cfg
.direnv
build/
# Releases folder
releases
chrome

74
ARCHITECTURE.md Normal file
View File

@@ -0,0 +1,74 @@
## Build pipeline
The GTK port has a fairly complicated build pipeline / system, chiefly stemming from our use of Colloid as a base theme.
We use Colloid as a base to reduce development overhead of creating our own theme from scratch, we look to replace this in the future
to give us more flexibility and control over the theme (see https://github.com/catppuccin/gtk/issues/164).
We have reimplemented Colloid's build system (previously implemented in Shell) in Python to make it easier to maintain, extend, and iterate on.
With this re-implementation, we have several distinct components in the system, described below:
1) Patching
2) SCSS
2) Assets
## Patching
We patch our colloid submodule to add additional functionality and (temporarily) fix bugs found in Colloid.
We do this through `.patch` files, applied with `git apply` when the build script boots up.
The build script will store some state in the submodule to ensure it does not get needlessly patched.
The patches are stored in `patches/colloid`, and currently have our palette, the Plank theme, and a modification to Colloid
to allow all of our accents to load. When we find issues in Colloid, they will be patched through this system before being submitted upstream.
## SCSS
[This section assumes the directory root is at `colliod/src/sass`]
The bulk of the theme is implemented here, in SCSS. This is by far the most modular part of Colloid out of the box, requiring minimal patching from our end to function.
To start, we move the Colloid submodule into its own temporary copy. This is to allow us to run multiple builds in parallel, which would be otherwise impossible due to the
file changes necessitated by each build, described below.
With our temporary copy established, we generate the 'tweaks' for the build. This sets up a file (`_tweaks-temp.scss`) which describes the various knobs and dials for the build:
```scss
@import 'color-palette-catppuccin-mocha';
$colorscheme: 'catppuccin';
$colortype: 'system';
$opacity: 'default';
$theme: 'mauve';
$compact: 'false';
$translucent: 'false';
$panel_opacity: 1.0;
$blackness: 'false';
$rimless: 'false';
$window_button: 'mac';
$float: 'false';
```
We edit in the correct palette import for the flavour we're building, and set the other variables based on user / build state input.
With the tweaks setup, we can now invoke `sassc` (the SCSS compiler) to build all of our CSS files. We run all of the SCSS builds in parallel, for performance.
With the SCSS complete, we have now finished most of the work required for the build.
## Assets
We build our own assets to ship with the theme, based on the processes used in Colloid.
We build assets for GTK, to include UI elements such as buttons, checkboxes,
etc. This is done through standard find-and-replace, as these assets are just SVGs. We do not support GTK2, so do not have to support the older PNG assets used there.
We also build assets for Xfce's Xfwm4, which are first patched from a source SVG, and then rendered through the `inkscape` CLI.
This operation is done once, at the start of a build process (e.g CI, to be reused for every subsequent build), or once until they change in the future for local development.
The script to generate these assets can be found at [`patches/xfwm4/generate_assets.py`](./patches/xfwm4/generate_assets.py)
## CI integration
The CI system utilizes the build system, as described above, but with some unique parallelization elements to improve performance.
We have chosen to only build a limited subset of possible tweaks in CI, to constrain the time it takes to run.
Currently, we build a matrix of:
- Flavor
- Accent
The CI will run all 4 flavours in parallel (see above for precautions taken to ensure this functions correctly), and build each accent serially.
We collate the logs for these runs into files so that they can be shown neatly at the end of the run.

70
CONTRIBUTING.md Normal file
View File

@@ -0,0 +1,70 @@
## Development
Information regarding the architecture of the project can be found [in the ARCHITECTURE.md](./ARCHITECTURE.md) document.
### 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).
### Upstreaming procedure
Now and again, Colloid will have bugs upstream that impacts our theme. With our patching system we can easily fix these problems,
but we still want to contribute the fixes upstream to benefit all users & forks of Colloid.
To avoid stalling unnecessarily, our procedure for the above is as follows:
1) Open a PR to fix the issue, by adding a patch file to our theme, add `upstream:intended`
to signal these changes are to be sent to Colloid eventually.
2) Merge the PR & close the issue in our theme pertaining to the issue, once reviewed and approved
3) Open a PR in Colloid with the patch
4) Open a new issue in our theme, with these details:
- The initial issue in our theme
- The PR in Colloid that fixes the issue there
- The PR that fixed the issue in our theme
Add the `upstream:open` label
5) Once the PR is merged in Colloid:
1) Test that the issue no longer persists, without our patch
2) Open a PR to remove the patch file in our theme, with these details:
- The tracking issue
- The commit that fixed the issue in Colloid
3) Close the tracking issue & merge the PR to remove the patch file
### Running test builds
We support building and publishing test builds from PRs. When you open PRs, the CI will automatically build with your changes and push an artifact
which bundles all of the produced themes.
You can then download the artifacts as a zip (result should look similar to 7bff2448a81e36bf3b0e03bfbd649bebe6973ec7-artifacts.zip) and
pass the path into `install.py` under the `--from-artifact` option:
```bash
python3 install.py mocha blue --dest ./build --from-artifact ~/downloads/7bff2448a81e36bf3b0e03bfbd649bebe6973ec7-artifacts.zip
```
This will take the target flavor / accent out of the zip, and install it using the regular install process.
It is advised to pass a `--dest` when running in this mode, because the released zips follow the exact same naming scheme as regular builds.
This wil cause conflicts when you install, if you already had that theme installed. Passing a different destination allows you to move the
extracted folders to `~/.local/share/themes` yourself, adding a suffix as appropriate to avoid conflicts.
> [!WARNING]
> If you pass `--link` to the install script when working from a PR, it will forcibly overwrite your `~/.config/gtk-4.0/` symlinks.
> You will have to reinstall / relink to revert this.
### Useful resources
- GNOME-shell sources: https://gitlab.gnome.org/GNOME/gnome-shell/-/tree/gnome-46/data/theme
- GTK inspector guide: https://developer.gnome.org/documentation/tools/inspector.html

210
README.md
View File

@@ -15,91 +15,175 @@
<img src="assets/res.webp"/>
</p>
# About
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)
## Installation
## Usage
This GTK theme requires:
- GTK `>=3.20`
- Python 3+
### Automated script
We provide a Python script to automate the process of installing the theme:
```bash
curl -LsS "https://raw.githubusercontent.com/catppuccin/gtk/main/install.py" -o install.py
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!
```
### Arch Linux
With your favourite AUR helper, you can install your flavor of choice:
```bash
yay -S catppuccin-gtk-theme-<flavor>
paru -S catppuccin-gtk-theme-<flavor>
```
### 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.
You can set up our Nix module for GTK with the following config:
```nix
{inputs, ...}: {
imports = [inputs.catppuccin.homeManagerModules.catppuccin];
gtk = {
enable = true;
catppuccin = {
enable = true;
flavor = "mocha";
accent = "pink";
size = "standard";
tweaks = [ "normal" ];
};
};
}
```
> [!TIP]
> 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).
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)
## Flatpak
Flatpak by default restricts access to themes, to allow access, use the following:
```bash
sudo flatpak override --filesystem=$HOME/.local/share/themes
```
After you've allowed access, set the theme, using the following:
```bash
# Change to suite your flavor / accent combination
export FLAVOR="mocha"
export ACCENT="mauve"
# Set the theme
sudo flatpak override --env=GTK_THEME="catppuccin-${FLAVOR}-${ACCENT}-standard+default"
```
### Manual installation
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).
```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="$HOME/.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
- GTK `>=3.20`
- `gnome-themes-extra` (or `gnome-themes-standard`)
- Murrine engine
- Python 3+
- `sassc`, the Sass compiler
- `inkscape`, `optipng`, for rendering PNGs
### Installation
> [!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.
1. Download and extract the **Catppuccin-Flavour.zip** file. or **Catppuccin-Flavour-Color.zip** file.
[From Release](https://github.com/sadrach-cl/catppuccin-gtk/releases/) or you can install the theme from the [AUR](#for-arch-linux-users)
2. Move the theme folder to **".themes"** in your home directory. **(~/.themes)** (Skip this step if you are using the AUR package)
3. Select **"Catppuccin-Flavour** or **Catppuccin-Flavour-Color"** via your desktop specific tweaks application (**gnome-tweaks** on Gnome3+).
To build the theme, simply invoke `build.py`:
### 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/)
### 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
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!
```
## Development
**Note**: Ensure that you have atleast python version 3.10 installed
Clone the repository using
```bash
git clone --recurse-submodules git@github.com:catppuccin/gtk.git
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
```
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 output it to releases folder in the root of the repo.
```bash
python build.py
```
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.
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
**Current maintainers**
- [nullishamy](https://github.com/nullishamy)
- [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;

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 5.1 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 922 KiB

636
build.py Executable file
View File

@@ -0,0 +1,636 @@
#!/usr/bin/env python3
import os, re, shutil, subprocess, argparse, glob, logging, zipfile, sys
from dataclasses import dataclass
from typing import Any, Literal, List
from catppuccin import PALETTE
from catppuccin.models import Flavor, Color
THIS_DIR = os.path.dirname(os.path.realpath(__file__))
SRC_DIR = f"{THIS_DIR}/colloid/src"
SASSC_OPT = ["-M", "-t", "expanded"]
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 Tweaks:
tweaks: List[str]
def has(self, tweak: str) -> bool:
return tweak in self.tweaks
def id(self) -> str:
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
class BuildContext:
build_root: str
output_format: Literal["zip"] | Literal["dir"]
theme_name: str
flavor: Flavor
accent: Color
size: Literal["standard"] | Literal["compact"]
tweaks: Tweaks
def output_dir(self) -> str:
suffix = "light"
if self.flavor.dark:
suffix = "dark"
return f"{self.build_root}/{self.build_id()}-{suffix}"
def build_id(self) -> str:
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):
output_dir = ctx.output_dir()
logger.info(f"Building into '{output_dir}'...")
apply_tweaks(ctx)
os.makedirs(output_dir, exist_ok=True)
with open(f"{output_dir}/index.theme", "w") as file:
file.write("[Desktop Entry]\n")
file.write("Type=X-GNOME-Metatheme\n")
file.write(f"Name={ctx.build_id()}\n")
file.write("Comment=An Flat Gtk+ theme based on Elegant Design\n")
file.write("Encoding=UTF-8\n")
file.write("\n")
file.write("[X-GNOME-Metatheme]\n")
file.write(f"GtkTheme={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"CursorTheme={ctx.flavor.name}-cursors\n")
file.write("ButtonLayout=close,minimize,maximize:menu\n")
os.makedirs(f"{output_dir}/gnome-shell", exist_ok=True)
shutil.copyfile(
f"{SRC_DIR}/main/gnome-shell/pad-osd.css",
f"{output_dir}/gnome-shell/pad-osd.css",
)
subprocess.check_call(
[
"sassc",
*SASSC_OPT,
f"{SRC_DIR}/main/gnome-shell/gnome-shell{ctx.apply_suffix(DARK_LIGHT)}.scss",
f"{output_dir}/gnome-shell/gnome-shell.css",
]
)
os.makedirs(f"{output_dir}/gtk-3.0", exist_ok=True)
subprocess.check_call(
[
"sassc",
*SASSC_OPT,
f"{SRC_DIR}/main/gtk-3.0/gtk{ctx.apply_suffix(DARK_LIGHT)}.scss",
f"{output_dir}/gtk-3.0/gtk.css",
]
)
subprocess.check_call(
[
"sassc",
*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"{output_dir}/gtk-3.0/gtk-dark.css",
]
)
os.makedirs(f"{output_dir}/gtk-4.0", exist_ok=True)
subprocess.check_call(
[
"sassc",
*SASSC_OPT,
f"{SRC_DIR}/main/gtk-4.0/gtk{ctx.apply_suffix(DARK_LIGHT)}.scss",
f"{output_dir}/gtk-4.0/gtk.css",
]
)
subprocess.check_call(
[
"sassc",
*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"{output_dir}/gtk-4.0/gtk-dark.css",
]
)
os.makedirs(f"{output_dir}/cinnamon", exist_ok=True)
subprocess.check_call(
[
"sassc",
*SASSC_OPT,
f"{SRC_DIR}/main/cinnamon/cinnamon{ctx.apply_suffix(DARK_LIGHT)}.scss",
f"{output_dir}/cinnamon/cinnamon.css",
]
)
os.makedirs(f"{output_dir}/metacity-1", exist_ok=True)
shutil.copyfile(
f"{SRC_DIR}/main/metacity-1/metacity-theme-3{ctx.apply_suffix(IS_WINDOW_NORMAL)}.xml",
f"{output_dir}/metacity-1/metacity-theme-3.xml",
)
# FIXME: Symlinks aren't working as intended
# FIXME: Do we need them?
# os.symlink(
# f"{output_dir}/metacity-1/metacity-theme-3.xml",
# f"{output_dir}/metacity-1/metacity-theme-2.xml",
# )
# os.symlink(
# f"{output_dir}/metacity-1/metacity-theme-3.xml",
# f"{output_dir}/metacity-1/metacity-theme-1.xml",
# )
os.makedirs(f"{output_dir}/xfwm4", exist_ok=True)
shutil.copyfile(
f"{SRC_DIR}/main/xfwm4/themerc{ctx.apply_suffix(IS_LIGHT)}",
f"{output_dir}/xfwm4/themerc",
)
os.makedirs(f"{output_dir}-hdpi/xfwm4", exist_ok=True)
shutil.copyfile(
f"{SRC_DIR}/main/xfwm4/themerc{ctx.apply_suffix(IS_LIGHT)}",
f"{output_dir}-hdpi/xfwm4/themerc",
)
subst_text(f"{output_dir}-hdpi/xfwm4/themerc", "button_offset=6", "button_offset=9")
os.makedirs(f"{output_dir}-xhdpi/xfwm4", exist_ok=True)
shutil.copyfile(
f"{SRC_DIR}/main/xfwm4/themerc{ctx.apply_suffix(IS_LIGHT)}",
f"{output_dir}-xhdpi/xfwm4/themerc",
)
subst_text(
f"{output_dir}-xhdpi/xfwm4/themerc", "button_offset=6", "button_offset=12"
)
if not ctx.flavor.dark:
shutil.copytree(
f"{SRC_DIR}/main/plank/theme-Light-Catppuccin/", f"{output_dir}/plank", dirs_exist_ok=True
)
else:
shutil.copytree(
f"{SRC_DIR}/main/plank/theme-Dark-Catppuccin/", f"{output_dir}/plank", dirs_exist_ok=True
)
def init_tweaks_temp():
shutil.copyfile(f"{SRC_DIR}/sass/_tweaks.scss", f"{SRC_DIR}/sass/_tweaks-temp.scss")
def subst_text(path, _from, to):
with open(path, "r+") as f:
content = f.read()
f.seek(0)
f.truncate()
f.write(re.sub(_from, to, content))
GS_VERSION = "46-0"
def gnome_shell_version():
shutil.copyfile(
f"{SRC_DIR}/sass/gnome-shell/_common.scss",
f"{SRC_DIR}/sass/gnome-shell/_common-temp.scss",
)
subst_text(
f"{SRC_DIR}/sass/gnome-shell/_common-temp.scss",
"@import 'widgets-40-0';",
f"@import 'widgets-{GS_VERSION}';",
)
if GS_VERSION == "3-28":
subst_text(
f"{SRC_DIR}/sass/gnome-shell/_common-temp.scss",
"@import 'extensions-40-0';",
f"@import 'extensions-{GS_VERSION}';",
)
def write_tweak(key, default, value):
subst_text(
f"{SRC_DIR}/sass/_tweaks-temp.scss", f"\\${key}: {default}", f"${key}: {value}"
)
def apply_tweaks(ctx: BuildContext):
write_tweak("theme", "'default'", f"'{ctx.accent.identifier}'")
if ctx.size == "compact":
write_tweak("compact", "'false'", "'true'")
subst_text(
f"{SRC_DIR}/sass/_tweaks-temp.scss",
"@import 'color-palette-default';",
f"@import 'color-palette-catppuccin-{ctx.flavor.identifier}';",
)
write_tweak("colorscheme", "'default'", "'catppuccin'")
if ctx.tweaks.has("black"):
write_tweak("blackness", "'false'", "'true'")
if ctx.tweaks.has("rimless"):
write_tweak("rimless", "'false'", "'true'")
if ctx.tweaks.has("normal"):
write_tweak("window_button", "'mac'", "'normal'")
if ctx.tweaks.has("float"):
write_tweak("float", "'false'", "'true'")
def make_assets(ctx: BuildContext):
output_dir = ctx.output_dir()
os.makedirs(f"{output_dir}/cinnamon/assets", exist_ok=True)
for file in glob.glob(f"{SRC_DIR}/assets/cinnamon/theme/*.svg"):
shutil.copy(file, f"{output_dir}/cinnamon/assets")
shutil.copy(
f"{SRC_DIR}/assets/cinnamon/thumbnail{ctx.apply_suffix(DARK_LIGHT)}.svg",
f"{output_dir}/cinnamon/thumbnail.png",
)
os.makedirs(f"{output_dir}/gnome-shell/assets", exist_ok=True)
for file in glob.glob(f"{SRC_DIR}/assets/gnome-shell/theme/*.svg"):
shutil.copy(file, f"{output_dir}/gnome-shell/assets")
shutil.copytree(
f"{SRC_DIR}/assets/gtk/assets",
f"{output_dir}/gtk-3.0/assets",
dirs_exist_ok=True,
)
shutil.copytree(
f"{SRC_DIR}/assets/gtk/assets",
f"{output_dir}/gtk-4.0/assets",
dirs_exist_ok=True,
)
shutil.copyfile(
f"{SRC_DIR}/assets/gtk/thumbnail{ctx.apply_suffix(IS_DARK)}.svg",
f"{output_dir}/gtk-3.0/thumbnail.png",
)
shutil.copyfile(
f"{SRC_DIR}/assets/gtk/thumbnail{ctx.apply_suffix(IS_DARK)}.svg",
f"{output_dir}/gtk-4.0/thumbnail.png",
)
theme_color = ctx.accent.hex
palette = ctx.flavor.colors
background = palette.base.hex
background_alt = palette.mantle.hex
titlebar = palette.overlay0.hex
for file in glob.glob(f"{output_dir}/cinnamon/assets/*.svg"):
subst_text(file, "#5b9bf8", theme_color)
subst_text(file, "#3c84f7", theme_color)
for file in glob.glob(f"{output_dir}/gnome-shell/assets/*.svg"):
subst_text(file, "#5b9bf8", theme_color)
subst_text(file, "#3c84f7", theme_color)
for file in glob.glob(f"{output_dir}/gtk-3.0/assets/*.svg"):
subst_text(file, "#5b9bf8", theme_color)
subst_text(file, "#3c84f7", theme_color)
subst_text(file, "#ffffff", background)
subst_text(file, "#2c2c2c", background)
subst_text(file, "#3c3c3c", background_alt)
for file in glob.glob(f"{output_dir}/gtk-4.0/assets/*.svg"):
subst_text(file, "#5b9bf8", theme_color)
subst_text(file, "#3c84f7", theme_color)
subst_text(file, "#ffffff", background)
subst_text(file, "#2c2c2c", background)
subst_text(file, "#3c3c3c", background_alt)
if ctx.flavor.dark:
subst_text(f"{output_dir}/cinnamon/thumbnail.png", "#2c2c2c", background)
subst_text(f"{output_dir}/cinnamon/thumbnail.png", "#5b9bf8", theme_color)
subst_text(f"{output_dir}/gtk-3.0/thumbnail.png", "#2c2c2c", background)
subst_text(f"{output_dir}/gtk-4.0/thumbnail.png", "#2c2c2c", background)
subst_text(f"{output_dir}/gtk-3.0/thumbnail.png", "#5b9bf8", theme_color)
subst_text(f"{output_dir}/gtk-4.0/thumbnail.png", "#5b9bf8", theme_color)
else:
subst_text(f"{output_dir}/cinnamon/thumbnail.png", "#ffffff", background)
subst_text(f"{output_dir}/cinnamon/thumbnail.png", "#f2f2f2", titlebar)
subst_text(f"{output_dir}/cinnamon/thumbnail.png", "#3c84f7", theme_color)
subst_text(f"{output_dir}/gtk-3.0/thumbnail.png", "#f2f2f2", titlebar)
subst_text(f"{output_dir}/gtk-3.0/thumbnail.png", "#3c84f7", theme_color)
subst_text(f"{output_dir}/gtk-4.0/thumbnail.png", "#f2f2f2", titlebar)
subst_text(f"{output_dir}/gtk-4.0/thumbnail.png", "#3c84f7", theme_color)
for file in glob.glob(f"{SRC_DIR}/assets/cinnamon/common-assets/*.svg"):
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"):
shutil.copy(file, f"{output_dir}/cinnamon/assets")
for file in glob.glob(f"{SRC_DIR}/assets/gnome-shell/common-assets/*.svg"):
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"):
shutil.copy(file, f"{output_dir}/gnome-shell/assets")
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-4.0/assets")
for file in glob.glob(f"{SRC_DIR}/assets/metacity-1/assets{ctx.apply_suffix(IS_WINDOW_NORMAL)}/*.svg"):
shutil.copy(file, f"{output_dir}/metacity-1/assets")
shutil.copy(
f"{SRC_DIR}/assets/metacity-1/thumbnail{ctx.apply_suffix(IS_DARK)}.png",
f"{output_dir}/metacity-1/thumbnail.png",
)
xfwm4_assets_root = f"{THIS_DIR}/patches/xfwm4/generated/assets-catppuccin-{ctx.flavor.identifier}"
for file in glob.glob(xfwm4_assets_root + '/*'):
shutil.copy(file, f"{output_dir}/xfwm4")
xfwm4_assets = xfwm4_assets_root + "-hdpi/*"
for file in glob.glob(xfwm4_assets):
shutil.copy(file, f"{output_dir}-hdpi/xfwm4")
xfwm4_assets = xfwm4_assets_root + "-xhdpi/*"
for file in glob.glob(xfwm4_assets):
shutil.copy(file, f"{output_dir}-xhdpi/xfwm4")
def zip_dir(path, zip_file):
# Ref: https://stackoverflow.com/questions/46229764/python-zip-multiple-directories-into-one-zip-file
for root, _, files in os.walk(path):
for file in files:
zip_file.write(
os.path.join(root, file),
os.path.relpath(os.path.join(root, file), os.path.join(path, "..")),
)
def zip_artifacts(dir_list, zip_name, remove=True):
with zipfile.ZipFile(zip_name, "w", zipfile.ZIP_DEFLATED) as zipf:
for dir in dir_list:
zip_dir(dir, zipf)
if remove:
for dir in dir_list:
shutil.rmtree(dir)
def build_theme(ctx: BuildContext):
build_info = f"""Build info:
build_root: {ctx.build_root}
theme_name: {ctx.theme_name}
flavor: {ctx.flavor.identifier}
accent: {ctx.accent.identifier}
size: {ctx.size}
tweaks: {ctx.tweaks}"""
logger.info(build_info)
build(ctx)
logger.info(f"Main build complete")
logger.info("Bundling assets...")
make_assets(ctx)
logger.info("Asset bundling done")
if ctx.output_format == "zip":
zip_artifacts(
[
ctx.output_dir(),
f"{ctx.output_dir()}-hdpi",
f"{ctx.output_dir()}-xhdpi",
],
f"{ctx.build_root}/{ctx.build_id()}.zip",
True,
)
"""
if (command -v xfce4-popup-whiskermenu &> /dev/null) && $(sed -i "s|.*menu-opacity=.*|menu-opacity=95|" "$HOME/.config/xfce4/panel/whiskermenu"*".rc" &> /dev/null); then
sed -i "s|.*menu-opacity=.*|menu-opacity=95|" "$HOME/.config/xfce4/panel/whiskermenu"*".rc"
fi
if (pgrep xfce4-session &> /dev/null); then
xfce4-panel -r
fi
"""
def apply_colloid_patches():
if os.path.isfile("colloid/.patched"):
logger.info(
'Patches seem to be applied, remove "colloid/.patched" to force application (this may fail)'
)
return
logger.info("Applying patches...")
# Change into colloid
for patch in [
"plank-dark.patch",
"plank-light.patch",
"theme-func.patch",
"sass-palette-frappe.patch",
"sass-palette-mocha.patch",
"sass-palette-latte.patch",
"sass-palette-macchiato.patch",
]:
path = f"./patches/colloid/{patch}"
logger.info(f"Applying patch '{patch}', located at '{path}'")
subprocess.check_call(["git", "apply", path, "--directory", f"colloid"])
with open("colloid/.patched", "w") as f:
f.write("true")
logger.info("Patching finished.")
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(
"--name",
"-n",
type=str,
default="catppuccin",
dest="name",
help="Name of the theme to apply.",
)
parser.add_argument(
"--dest",
"-d",
type=str,
required=True,
dest="dest",
help="Destination of the files.",
)
parser.add_argument(
"--accent",
"-a",
type=str,
default="mauve",
nargs='+',
dest="accents",
choices=[
"rosewater",
"flamingo",
"pink",
"mauve",
"red",
"maroon",
"peach",
"yellow",
"green",
"teal",
"sky",
"sapphire",
"blue",
"lavender",
],
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(
"--size",
"-s",
type=str,
default="standard",
dest="size",
choices=["standard", "compact"],
help="Size variant of the theme.",
)
parser.add_argument(
"--tweaks",
type=str,
default=[],
nargs="+",
dest="tweaks",
choices=["black", "rimless", "normal", "float"],
help="Tweaks to apply to the build.",
)
parser.add_argument(
"--zip",
help="Whether to bundle the theme into a zip",
type=bool,
default=False,
action=argparse.BooleanOptionalAction,
)
parser.add_argument(
"--patch",
help="Whether to patch the colloid submodule",
type=bool,
default=True,
action=argparse.BooleanOptionalAction,
)
return parser.parse_args()
def main():
args = parse_args()
if args.patch:
apply_colloid_patches()
if args.zip:
output_format = "zip"
else:
output_format = "dir"
tweaks = Tweaks(tweaks=args.tweaks)
palette = getattr(PALETTE, args.flavor)
accents = args.accents
if args.all_accents:
accents = [
"rosewater",
"flamingo",
"pink",
"mauve",
"red",
"maroon",
"peach",
"yellow",
"green",
"teal",
"sky",
"sapphire",
"blue",
"lavender",
]
for accent in accents:
accent = getattr(palette.colors, 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")
init_tweaks_temp()
logger.info("Inserting gnome-shell imports")
gnome_shell_version()
logger.info("Building main theme")
build_theme(ctx)
logger.info(f"Completed {palette.identifier} with {accent.identifier}")
logger.info("Done!")
try:
main()
except Exception as e:
logger.error("Something went wrong when building the theme:", exc_info=e)
sys.exit(1)

Submodule colloid updated: 5b08fdbf1c...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

@@ -1,91 +1,216 @@
"""
Main script to clone, recolor and install the theme.
Run this from the root of the repo.
#!/usr/bin/env python3
Usage:
python install.py [options]
"""
import argparse
import os, zipfile, argparse, logging, io
from typing import Optional
from pathlib import Path
from dataclasses import dataclass
from urllib.request import urlopen, Request
from urllib.parse import urlparse
from scripts.ctp_colors import ctp_colors, get_all_accent
from scripts.create_theme import create_theme
from scripts.var import theme_name, tmp_dir
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)
parser = argparse.ArgumentParser(description="Catppuccin theme")
parser.add_argument("flavor",
metavar="theme flavor",
@dataclass
class InstallContext:
flavor: str
accent: str
dest: Path
link: bool
def build_info(self, include_url=True) -> str:
url = build_release_url(self)
info = f"""Installation info:
flavor: {self.flavor}
accent: {self.accent}
dest: {self.dest.absolute()}
link: {self.link}"""
if include_url:
info += f"\nremote_url: {url}"
return info
def parse_args():
parser = argparse.ArgumentParser()
parser.add_argument(
"flavor",
type=str,
nargs="+",
choices=["mocha", "frappe", "macchiato", "latte", "all"],
help="Flavor of the theme to apply. Can be frappe, mocha, macchiato, latte")
choices=["mocha", "frappe", "macchiato", "latte"],
help="Flavor of the theme to apply.",
)
parser.add_argument("--name", "-n",
metavar="theme name",
parser.add_argument(
"accent",
type=str,
default=theme_name,
dest="name",
help="Name of the theme to apply. Defaults to Catppuccin")
default="mauve",
choices=[
"rosewater",
"flamingo",
"pink",
"mauve",
"red",
"maroon",
"peach",
"yellow",
"green",
"teal",
"sky",
"sapphire",
"blue",
"lavender",
],
help="Accent of the theme.",
)
parser.add_argument("--dest", "-d",
metavar="destination",
parser.add_argument(
"--from-artifact",
type=Path,
dest="from_artifact",
help="Install from an artifact instead of a mainline release, pass the artifact path (e.g 7bff2448a81e36bf3b0e03bfbd649bebe6973ec7-artifacts.zip)",
)
parser.add_argument(
"--dest",
"-d",
type=str,
default=tmp_dir,
dest="dest",
help="Destination of the files. defaults to releases folder inside the root")
help="Destination of the files.",
)
parser.add_argument("--accent", "-a",
metavar="Accent of the theme",
type=str,
nargs="+",
default=["blue"],
dest="accent",
choices=["rosewater", "flamingo", "pink", "mauve", "red", "maroon", "peach",
"yellow", "green", "teal", "sky", "sapphire", "blue", "lavender", "all"],
help="Accent of the theme. Can include 'rosewater', 'flamingo', 'pink', 'mauve', 'red', 'maroon', \
'peach', 'yellow', 'green', 'teal', 'sky', 'sapphire', 'blue', 'lavender'")
parser.add_argument("--size", "-s",
metavar="Size of the theme",
type=str,
default="standard",
dest="size",
choices=["standard", "compact"],
help="Size variant of the theme. Can be standard or compact")
parser.add_argument("--tweaks",
metavar="Colloid specific tweaks",
type=str,
default=[],
nargs="+",
dest="tweaks",
choices=["black", "rimless", "normal"],
help="Some specifc tweaks. like black, rimless, normal buttons")
parser.add_argument("-l", "--link",
help="Link advaita themes to our catppuccin theme",
parser.add_argument(
"--link",
help="Whether to add symlinks for libadwaita",
type=bool,
default=False,
action=argparse.BooleanOptionalAction,
dest="link")
)
parser.add_argument("--zip",
help="Zip catppuccin theme",
type=bool,
default=False,
action=argparse.BooleanOptionalAction,
dest="zip")
return parser.parse_args()
args = parser.parse_args()
if "all" in args.flavor:
flavors = ctp_colors.keys()
else:
flavors = args.flavor
def build_release_url(ctx: InstallContext) -> str:
repo_root = "https://github.com/catppuccin/gtk/releases/download"
release = "v1.0.0-rc5"
zip_name = f"catppuccin-{ctx.flavor}-{ctx.accent}-standard+default.zip"
if "all" in args.accent:
accents = get_all_accent().keys()
else:
accents = args.accent
return f"{repo_root}/{release}/{zip_name}"
filename = create_theme(flavors, accents, args.dest,
args.link, args.name, args.size, args.tweaks, args.zip)
def fetch_zip(url: str) -> Optional[zipfile.ZipFile]:
req = Request(url)
zip_file = None
logger.info("Starting download...")
with urlopen(req) 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 None
logger.info("Download verified")
return zip_file
def add_libadwaita_links(ctx: InstallContext, rewrite: bool = False):
suffix = "light"
if ctx.flavor != "latte":
suffix = "dark"
dir_name = (
ctx.dest / f"catppuccin-{ctx.flavor}-{ctx.accent}-standard+default-{suffix}" / "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}")
try:
if rewrite:
os.remove(gtk4_dir / "assets")
os.remove(gtk4_dir / "gtk.css")
os.remove(gtk4_dir / "gtk-dark.css")
except FileNotFoundError:
logger.debug("Ignoring FileNotFound in symlink rewrite")
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 install(ctx: InstallContext):
url = build_release_url(ctx)
logger.info(ctx.build_info())
zip_file = fetch_zip(url)
if zip_file is None:
return
logger.info("Extracting...")
zip_file.extractall(ctx.dest)
logger.info("Extraction complete")
if ctx.link:
add_libadwaita_links(ctx)
def install_from_artifact(ctx: InstallContext, artifact_path: Path):
# Working from a pull request, special case it
logger.info(f"Extracting artifact from '{artifact_path}'")
artifacts = zipfile.ZipFile(artifact_path)
logger.info("Verifying artifact...")
first_bad_file = artifacts.testzip()
if first_bad_file is not None:
logger.error(f'Zip appears to be corrupt, first bad file is "{first_bad_file}"')
return None
logger.info("Artifact verified")
logger.info(ctx.build_info(False))
# The zip, inside the artifacts, that we want to pull out
zip_name = f"catppuccin-{ctx.flavor}-{ctx.accent}-standard+default.zip"
logger.info(f"Pulling '{zip_name}' from the artifacts")
info = artifacts.getinfo(zip_name)
logger.info("Extracting the artifact...")
artifact = zipfile.ZipFile(io.BytesIO(artifacts.read(info)))
artifact.extractall(ctx.dest)
logger.info("Extraction complete")
if ctx.link:
logger.info("Adding links (with rewrite)")
add_libadwaita_links(ctx, True)
logger.info("Links added")
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
)
if args.from_artifact:
install_from_artifact(ctx, args.from_artifact)
return
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)

View File

@@ -0,0 +1,123 @@
---
whiskers:
version: 2.1.0
matrix:
- flavor
filename: 'sass-palette-{{ flavor.identifier }}.patch'
---
{%- set palette = flavor.colors -%}
diff --git a/src/sass/_color-palette-catppuccin-{{ flavor.identifier }}.scss b/src/sass/_color-palette-catppuccin-{{ flavor.identifier }}.scss
new file mode 100644
index 00000000..4ff0da0d
--- /dev/null
+++ b/src/sass/_color-palette-catppuccin-{{ flavor.identifier }}.scss
@@ -0,0 +1,87 @@
+ // Our accents
+ $rosewater: #{{ palette.rosewater.hex }};
+ $flamingo: #{{ palette.flamingo.hex }};
+ $pink: #{{ palette.pink.hex }};
+ $mauve: #{{ palette.mauve.hex }};
+ $red: #{{ palette.red.hex }};
+ $maroon: #{{ palette.maroon.hex }};
+ $peach: #{{ palette.peach.hex }};
+ $yellow: #{{ palette.yellow.hex }};
+ $green: #{{ palette.green.hex }};
+ $teal: #{{ palette.teal.hex }};
+ $sky: #{{ palette.sky.hex }};
+ $sapphire: #{{ palette.sapphire.hex }};
+ $blue: #{{ palette.blue.hex }};
+ $lavender: #{{ palette.lavender.hex }};
+// Default Theme Color Palette
+
+// Red
+$red-light: #{{ palette.red.hex }};
+$red-dark: #{{ palette.red.hex }};
+
+// Pink
+$pink-light: #{{ palette.pink.hex }};
+$pink-dark: #{{ palette.pink.hex }};
+
+// Purple
+$purple-light: #{{ palette.mauve.hex }};
+$purple-dark: #{{ palette.mauve.hex }};
+
+// Blue
+$blue-light: #{{ palette.blue.hex }};
+$blue-dark: #{{ palette.blue.hex }};
+
+// Teal
+$teal-light: #{{ palette.teal.hex }};
+$teal-dark: #{{ palette.teal.hex }};
+
+// Green
+$green-light: #{{ palette.green.hex }};
+$green-dark: #{{ palette.green.hex }};
+
+// Yellow
+$yellow-light: #{{ palette.yellow.hex }};
+$yellow-dark: #{{ palette.yellow.hex }};
+
+// Orange
+$orange-light: #{{ palette.peach.hex }};
+$orange-dark: #{{ palette.peach.hex }};
+
+// Grey
{% if flavor.dark -%} {#- https://github.com/catppuccin/gtk/blob/0c3e8817da94769887c690b2211e006b287b27b1/scripts/recolor.py#L153-L176 -#}
+$grey-050: #{{ palette.overlay2.hex }};
+$grey-100: #{{ palette.overlay1.hex }};
+$grey-150: #{{ palette.overlay0.hex }};
+$grey-200: #{{ palette.surface2.hex }};
+$grey-250: #{{ palette.surface1.hex }};
+$grey-300: red;
+$grey-350: red;
+$grey-400: red;
+$grey-450: red;
+$grey-500: red;
+$grey-550: red;
+$grey-600: red;
+$grey-650: #{{ palette.surface0.hex }};
+$grey-700: #{{ palette.base.hex }};
+$grey-750: #{{ palette.mantle.hex }};
+$grey-800: #{{ palette.crust.hex }};
+$grey-850: #020202;
+$grey-900: #010101;
+$grey-950: #000000;
{%- else -%} {#- Light mode https://github.com/catppuccin/gtk/blob/0c3e8817da94769887c690b2211e006b287b27b1/scripts/recolor.py#L128-L151 -#}
+$grey-050: #{{ palette.crust.hex }};
+$grey-100: #{{ palette.mantle.hex }};
+$grey-150: #{{ palette.base.hex }};
+$grey-200: #{{ palette.surface0.hex }};
+$grey-250: #{{ palette.surface1.hex }};
+$grey-300: red;
+$grey-350: red;
+$grey-400: red;
+$grey-450: red;
+$grey-500: red;
+$grey-550: red;
+$grey-600: red;
+$grey-650: #{{ palette.base.hex }};
+$grey-700: #{{ palette.base.hex }};
+$grey-750: #{{ palette.mantle.hex }};
+$grey-800: #{{ palette.text.hex }};
+$grey-850: #020202;
+$grey-900: #010101;
+$grey-950: #000000;
{%- endif %}
+
+// White
+$white: #eff1f5;
+
+// Black
+$black: #11111b;
+
+// Button
+$button-close: #{{ palette.red.hex }};
+$button-max: #{{ palette.green.hex }};
+$button-min: #{{ palette.yellow.hex }};
+
+// Link
+$links: #{{ palette.sky.hex }};
+
+// Theme
+$default-light: $purple-light;
+$default-dark: $purple-dark;

View File

@@ -0,0 +1,70 @@
diff --git a/src/main/plank/theme-Dark-Catppuccin/dock.theme b/src/main/plank/theme-Dark-Catppuccin/dock.theme
new file mode 100644
index 00000000..26a6a747
--- /dev/null
+++ b/src/main/plank/theme-Dark-Catppuccin/dock.theme
@@ -0,0 +1,64 @@
+#This file based on:
+#https://git.launchpad.net/plank/tree/data/themes/Default/dock.theme
+
+[PlankTheme]
+#The roundness of the top corners.
+TopRoundness=16
+#The roundness of the bottom corners.
+BottomRoundness=0
+#The thickness (in pixels) of lines drawn.
+LineWidth=0
+#The color (RGBA) of the outer stroke.
+OuterStrokeColor=0;;0;;0;;0
+#The starting color (RGBA) of the fill gradient.
+FillStartColor=33;;33;;33;;255
+#The ending color (RGBA) of the fill gradient.
+FillEndColor=33;;33;;33;;255
+#The color (RGBA) of the inner stroke.
+InnerStrokeColor=33;;33;;33;;255
+
+[PlankDockTheme]
+#The padding on the left/right dock edges, in tenths of a percent of IconSize.
+HorizPadding=2
+#The padding on the top dock edge, in tenths of a percent of IconSize.
+TopPadding=2
+#The padding on the bottom dock edge, in tenths of a percent of IconSize.
+BottomPadding=1
+#The padding between items on the dock, in tenths of a percent of IconSize.
+ItemPadding=2
+#The size of item indicators, in tenths of a percent of IconSize.
+IndicatorSize=5
+#The size of the icon-shadow behind every item, in tenths of a percent of IconSize.
+IconShadowSize=0
+#The height (in percent of IconSize) to bounce an icon when the application sets urgent.
+UrgentBounceHeight=1.6666666666666667
+#The height (in percent of IconSize) to bounce an icon when launching an application.
+LaunchBounceHeight=0.625
+#The opacity value (0 to 1) to fade the dock to when hiding it.
+FadeOpacity=1
+#The amount of time (in ms) for click animations.
+ClickTime=0
+#The amount of time (in ms) to bounce an urgent icon.
+UrgentBounceTime=600
+#The amount of time (in ms) to bounce an icon when launching an application.
+LaunchBounceTime=600
+#The amount of time (in ms) for active window indicator animations.
+ActiveTime=150
+#The amount of time (in ms) to slide icons into/out of the dock.
+SlideTime=300
+#The time (in ms) to fade the dock in/out on a hide (if FadeOpacity is < 1).
+FadeTime=250
+#The time (in ms) to slide the dock in/out on a hide (if FadeOpacity is 1).
+HideTime=250
+#The size of the urgent glow (shown when dock is hidden), in tenths of a percent of IconSize.
+GlowSize=30
+#The total time (in ms) to show the hidden-dock urgent glow.
+GlowTime=10000
+#The time (in ms) of each pulse of the hidden-dock urgent glow.
+GlowPulseTime=2000
+#The hue-shift (-180 to 180) of the urgent indicator color.
+UrgentHueShift=150
+#The time (in ms) to move an item to its new position or its addition/removal to/from the dock.
+ItemMoveTime=450
+#Whether background and icons will unhide/hide with different speeds. The top-border of both will leave/hit the screen-edge at the same time.
+CascadeHide=true

View File

@@ -0,0 +1,70 @@
diff --git a/src/main/plank/theme-Light-Catppuccin/dock.theme b/src/main/plank/theme-Light-Catppuccin/dock.theme
new file mode 100644
index 00000000..a4029c96
--- /dev/null
+++ b/src/main/plank/theme-Light-Catppuccin/dock.theme
@@ -0,0 +1,64 @@
+#This file based on:
+#https://git.launchpad.net/plank/tree/data/themes/Default/dock.theme
+
+[PlankTheme]
+#The roundness of the top corners.
+TopRoundness=16
+#The roundness of the bottom corners.
+BottomRoundness=0
+#The thickness (in pixels) of lines drawn.
+LineWidth=0
+#The color (RGBA) of the outer stroke.
+OuterStrokeColor=0;;0;;0;;0
+#The starting color (RGBA) of the fill gradient.
+FillStartColor=242;;242;;242;;255
+#The ending color (RGBA) of the fill gradient.
+FillEndColor=242;;242;;242;;255
+#The color (RGBA) of the inner stroke.
+InnerStrokeColor=242;;242;;242;;255
+
+[PlankDockTheme]
+#The padding on the left/right dock edges, in tenths of a percent of IconSize.
+HorizPadding=2
+#The padding on the top dock edge, in tenths of a percent of IconSize.
+TopPadding=2
+#The padding on the bottom dock edge, in tenths of a percent of IconSize.
+BottomPadding=1
+#The padding between items on the dock, in tenths of a percent of IconSize.
+ItemPadding=2
+#The size of item indicators, in tenths of a percent of IconSize.
+IndicatorSize=5
+#The size of the icon-shadow behind every item, in tenths of a percent of IconSize.
+IconShadowSize=0
+#The height (in percent of IconSize) to bounce an icon when the application sets urgent.
+UrgentBounceHeight=1.6666666666666667
+#The height (in percent of IconSize) to bounce an icon when launching an application.
+LaunchBounceHeight=0.625
+#The opacity value (0 to 1) to fade the dock to when hiding it.
+FadeOpacity=1
+#The amount of time (in ms) for click animations.
+ClickTime=0
+#The amount of time (in ms) to bounce an urgent icon.
+UrgentBounceTime=600
+#The amount of time (in ms) to bounce an icon when launching an application.
+LaunchBounceTime=600
+#The amount of time (in ms) for active window indicator animations.
+ActiveTime=150
+#The amount of time (in ms) to slide icons into/out of the dock.
+SlideTime=300
+#The time (in ms) to fade the dock in/out on a hide (if FadeOpacity is < 1).
+FadeTime=250
+#The time (in ms) to slide the dock in/out on a hide (if FadeOpacity is 1).
+HideTime=250
+#The size of the urgent glow (shown when dock is hidden), in tenths of a percent of IconSize.
+GlowSize=30
+#The total time (in ms) to show the hidden-dock urgent glow.
+GlowTime=10000
+#The time (in ms) of each pulse of the hidden-dock urgent glow.
+GlowPulseTime=2000
+#The hue-shift (-180 to 180) of the urgent indicator color.
+UrgentHueShift=150
+#The time (in ms) to move an item to its new position or its addition/removal to/from the dock.
+ItemMoveTime=450
+#Whether background and icons will unhide/hide with different speeds. The top-border of both will leave/hit the screen-edge at the same time.
+CascadeHide=true

View File

@@ -0,0 +1,93 @@
diff --git a/src/sass/_color-palette-catppuccin-frappe.scss b/src/sass/_color-palette-catppuccin-frappe.scss
new file mode 100644
index 00000000..4ff0da0d
--- /dev/null
+++ b/src/sass/_color-palette-catppuccin-frappe.scss
@@ -0,0 +1,87 @@
+ // Our accents
+ $rosewater: #f2d5cf;
+ $flamingo: #eebebe;
+ $pink: #f4b8e4;
+ $mauve: #ca9ee6;
+ $red: #e78284;
+ $maroon: #ea999c;
+ $peach: #ef9f76;
+ $yellow: #e5c890;
+ $green: #a6d189;
+ $teal: #81c8be;
+ $sky: #99d1db;
+ $sapphire: #85c1dc;
+ $blue: #8caaee;
+ $lavender: #babbf1;
+// Default Theme Color Palette
+
+// Red
+$red-light: #e78284;
+$red-dark: #e78284;
+
+// Pink
+$pink-light: #f4b8e4;
+$pink-dark: #f4b8e4;
+
+// Purple
+$purple-light: #ca9ee6;
+$purple-dark: #ca9ee6;
+
+// Blue
+$blue-light: #8caaee;
+$blue-dark: #8caaee;
+
+// Teal
+$teal-light: #81c8be;
+$teal-dark: #81c8be;
+
+// Green
+$green-light: #a6d189;
+$green-dark: #a6d189;
+
+// Yellow
+$yellow-light: #e5c890;
+$yellow-dark: #e5c890;
+
+// Orange
+$orange-light: #ef9f76;
+$orange-dark: #ef9f76;
+
+// Grey
+$grey-050: #949cbb;
+$grey-100: #838ba7;
+$grey-150: #737994;
+$grey-200: #626880;
+$grey-250: #51576d;
+$grey-300: red;
+$grey-350: red;
+$grey-400: red;
+$grey-450: red;
+$grey-500: red;
+$grey-550: red;
+$grey-600: red;
+$grey-650: #414559;
+$grey-700: #303446;
+$grey-750: #292c3c;
+$grey-800: #232634;
+$grey-850: #020202;
+$grey-900: #010101;
+$grey-950: #000000;
+
+// White
+$white: #eff1f5;
+
+// Black
+$black: #11111b;
+
+// Button
+$button-close: #e78284;
+$button-max: #a6d189;
+$button-min: #e5c890;
+
+// Link
+$links: #99d1db;
+
+// Theme
+$default-light: $purple-light;
+$default-dark: $purple-dark;

View File

@@ -0,0 +1,93 @@
diff --git a/src/sass/_color-palette-catppuccin-latte.scss b/src/sass/_color-palette-catppuccin-latte.scss
new file mode 100644
index 00000000..4ff0da0d
--- /dev/null
+++ b/src/sass/_color-palette-catppuccin-latte.scss
@@ -0,0 +1,87 @@
+ // Our accents
+ $rosewater: #dc8a78;
+ $flamingo: #dd7878;
+ $pink: #ea76cb;
+ $mauve: #8839ef;
+ $red: #d20f39;
+ $maroon: #e64553;
+ $peach: #fe640b;
+ $yellow: #df8e1d;
+ $green: #40a02b;
+ $teal: #179299;
+ $sky: #04a5e5;
+ $sapphire: #209fb5;
+ $blue: #1e66f5;
+ $lavender: #7287fd;
+// Default Theme Color Palette
+
+// Red
+$red-light: #d20f39;
+$red-dark: #d20f39;
+
+// Pink
+$pink-light: #ea76cb;
+$pink-dark: #ea76cb;
+
+// Purple
+$purple-light: #8839ef;
+$purple-dark: #8839ef;
+
+// Blue
+$blue-light: #1e66f5;
+$blue-dark: #1e66f5;
+
+// Teal
+$teal-light: #179299;
+$teal-dark: #179299;
+
+// Green
+$green-light: #40a02b;
+$green-dark: #40a02b;
+
+// Yellow
+$yellow-light: #df8e1d;
+$yellow-dark: #df8e1d;
+
+// Orange
+$orange-light: #fe640b;
+$orange-dark: #fe640b;
+
+// Grey
+$grey-050: #dce0e8;
+$grey-100: #e6e9ef;
+$grey-150: #eff1f5;
+$grey-200: #ccd0da;
+$grey-250: #bcc0cc;
+$grey-300: red;
+$grey-350: red;
+$grey-400: red;
+$grey-450: red;
+$grey-500: red;
+$grey-550: red;
+$grey-600: red;
+$grey-650: #eff1f5;
+$grey-700: #eff1f5;
+$grey-750: #e6e9ef;
+$grey-800: #4c4f69;
+$grey-850: #020202;
+$grey-900: #010101;
+$grey-950: #000000;
+
+// White
+$white: #eff1f5;
+
+// Black
+$black: #11111b;
+
+// Button
+$button-close: #d20f39;
+$button-max: #40a02b;
+$button-min: #df8e1d;
+
+// Link
+$links: #04a5e5;
+
+// Theme
+$default-light: $purple-light;
+$default-dark: $purple-dark;

View File

@@ -0,0 +1,93 @@
diff --git a/src/sass/_color-palette-catppuccin-macchiato.scss b/src/sass/_color-palette-catppuccin-macchiato.scss
new file mode 100644
index 00000000..4ff0da0d
--- /dev/null
+++ b/src/sass/_color-palette-catppuccin-macchiato.scss
@@ -0,0 +1,87 @@
+ // Our accents
+ $rosewater: #f4dbd6;
+ $flamingo: #f0c6c6;
+ $pink: #f5bde6;
+ $mauve: #c6a0f6;
+ $red: #ed8796;
+ $maroon: #ee99a0;
+ $peach: #f5a97f;
+ $yellow: #eed49f;
+ $green: #a6da95;
+ $teal: #8bd5ca;
+ $sky: #91d7e3;
+ $sapphire: #7dc4e4;
+ $blue: #8aadf4;
+ $lavender: #b7bdf8;
+// Default Theme Color Palette
+
+// Red
+$red-light: #ed8796;
+$red-dark: #ed8796;
+
+// Pink
+$pink-light: #f5bde6;
+$pink-dark: #f5bde6;
+
+// Purple
+$purple-light: #c6a0f6;
+$purple-dark: #c6a0f6;
+
+// Blue
+$blue-light: #8aadf4;
+$blue-dark: #8aadf4;
+
+// Teal
+$teal-light: #8bd5ca;
+$teal-dark: #8bd5ca;
+
+// Green
+$green-light: #a6da95;
+$green-dark: #a6da95;
+
+// Yellow
+$yellow-light: #eed49f;
+$yellow-dark: #eed49f;
+
+// Orange
+$orange-light: #f5a97f;
+$orange-dark: #f5a97f;
+
+// Grey
+$grey-050: #939ab7;
+$grey-100: #8087a2;
+$grey-150: #6e738d;
+$grey-200: #5b6078;
+$grey-250: #494d64;
+$grey-300: red;
+$grey-350: red;
+$grey-400: red;
+$grey-450: red;
+$grey-500: red;
+$grey-550: red;
+$grey-600: red;
+$grey-650: #363a4f;
+$grey-700: #24273a;
+$grey-750: #1e2030;
+$grey-800: #181926;
+$grey-850: #020202;
+$grey-900: #010101;
+$grey-950: #000000;
+
+// White
+$white: #eff1f5;
+
+// Black
+$black: #11111b;
+
+// Button
+$button-close: #ed8796;
+$button-max: #a6da95;
+$button-min: #eed49f;
+
+// Link
+$links: #91d7e3;
+
+// Theme
+$default-light: $purple-light;
+$default-dark: $purple-dark;

View File

@@ -0,0 +1,93 @@
diff --git a/src/sass/_color-palette-catppuccin-mocha.scss b/src/sass/_color-palette-catppuccin-mocha.scss
new file mode 100644
index 00000000..4ff0da0d
--- /dev/null
+++ b/src/sass/_color-palette-catppuccin-mocha.scss
@@ -0,0 +1,87 @@
+ // Our accents
+ $rosewater: #f5e0dc;
+ $flamingo: #f2cdcd;
+ $pink: #f5c2e7;
+ $mauve: #cba6f7;
+ $red: #f38ba8;
+ $maroon: #eba0ac;
+ $peach: #fab387;
+ $yellow: #f9e2af;
+ $green: #a6e3a1;
+ $teal: #94e2d5;
+ $sky: #89dceb;
+ $sapphire: #74c7ec;
+ $blue: #89b4fa;
+ $lavender: #b4befe;
+// Default Theme Color Palette
+
+// Red
+$red-light: #f38ba8;
+$red-dark: #f38ba8;
+
+// Pink
+$pink-light: #f5c2e7;
+$pink-dark: #f5c2e7;
+
+// Purple
+$purple-light: #cba6f7;
+$purple-dark: #cba6f7;
+
+// Blue
+$blue-light: #89b4fa;
+$blue-dark: #89b4fa;
+
+// Teal
+$teal-light: #94e2d5;
+$teal-dark: #94e2d5;
+
+// Green
+$green-light: #a6e3a1;
+$green-dark: #a6e3a1;
+
+// Yellow
+$yellow-light: #f9e2af;
+$yellow-dark: #f9e2af;
+
+// Orange
+$orange-light: #fab387;
+$orange-dark: #fab387;
+
+// Grey
+$grey-050: #9399b2;
+$grey-100: #7f849c;
+$grey-150: #6c7086;
+$grey-200: #585b70;
+$grey-250: #45475a;
+$grey-300: red;
+$grey-350: red;
+$grey-400: red;
+$grey-450: red;
+$grey-500: red;
+$grey-550: red;
+$grey-600: red;
+$grey-650: #313244;
+$grey-700: #1e1e2e;
+$grey-750: #181825;
+$grey-800: #11111b;
+$grey-850: #020202;
+$grey-900: #010101;
+$grey-950: #000000;
+
+// White
+$white: #eff1f5;
+
+// Black
+$black: #11111b;
+
+// Button
+$button-close: #f38ba8;
+$button-max: #a6e3a1;
+$button-min: #f9e2af;
+
+// Link
+$links: #89dceb;
+
+// Theme
+$default-light: $purple-light;
+$default-dark: $purple-dark;

View File

@@ -0,0 +1,46 @@
diff --git a/src/sass/_colors.scss b/src/sass/_colors.scss
index 8738bf37..71797c6d 100644
--- a/src/sass/_colors.scss
+++ b/src/sass/_colors.scss
@@ -58,27 +58,20 @@
}
@function theme($color) {
- @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; }
- @if ($theme == 'orange') { @return $orange-dark; }
- @if ($theme == 'yellow') { @return $yellow-dark; }
- @if ($theme == 'green') { @return $green-dark; }
- @if ($theme == 'teal') { @return $teal-dark; }
- @if ($theme == 'grey') { @return $grey-600; }
- } @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; }
- @if ($theme == 'orange') { @return $orange-light; }
- @if ($theme == 'yellow') { @return $yellow-light; }
- @if ($theme == 'green') { @return $green-light; }
- @if ($theme == 'teal') { @return $teal-light; }
- @if ($theme == 'grey') { @return $grey-200; }
- }
+ @if ($theme == 'rosewater') { @return $rosewater; }
+ @if ($theme == 'flamingo') { @return $flamingo; }
+ @if ($theme == 'pink') { @return $pink; }
+ @if ($theme == 'mauve') { @return $mauve; }
+ @if ($theme == 'red') { @return $red; }
+ @if ($theme == 'maroon') { @return $maroon; }
+ @if ($theme == 'peach') { @return $peach; }
+ @if ($theme == 'yellow') { @return $yellow; }
+ @if ($theme == 'green') { @return $green; }
+ @if ($theme == 'teal') { @return $teal; }
+ @if ($theme == 'sky') { @return $sky; }
+ @if ($theme == 'sapphire') { @return $sapphire; }
+ @if ($theme == 'blue') { @return $blue; }
+ @if ($theme == 'lavender') { @return $lavender; }
}
@function background($type) {

2
patches/xfwm4/.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
generated/
patched/

File diff suppressed because it is too large Load Diff

After

Width:  |  Height:  |  Size: 57 KiB

File diff suppressed because it is too large Load Diff

After

Width:  |  Height:  |  Size: 47 KiB

File diff suppressed because it is too large Load Diff

After

Width:  |  Height:  |  Size: 57 KiB

File diff suppressed because it is too large Load Diff

After

Width:  |  Height:  |  Size: 46 KiB

View File

@@ -0,0 +1,247 @@
from typing import List
from catppuccin import PALETTE
from catppuccin.models import Flavor
import re, os, shutil, subprocess, time
from dataclasses import dataclass
THIS_DIR = os.path.dirname(os.path.realpath(__file__))
INDEX = [
"close-active",
"close-inactive",
"close-prelight",
"close-pressed",
"hide-active",
"hide-inactive",
"hide-prelight",
"hide-pressed",
"maximize-active",
"maximize-inactive",
"maximize-prelight",
"maximize-pressed",
"maximize-toggled-active",
"maximize-toggled-inactive",
"maximize-toggled-prelight",
"maximize-toggled-pressed",
"menu-active",
"menu-inactive",
"menu-prelight",
"menu-pressed",
"shade-active",
"shade-inactive",
"shade-prelight",
"shade-pressed",
"shade-toggled-active",
"shade-toggled-inactive",
"shade-toggled-prelight",
"shade-toggled-pressed",
"stick-active",
"stick-inactive",
"stick-prelight",
"stick-pressed",
"stick-toggled-active",
"stick-toggled-inactive",
"stick-toggled-prelight",
"stick-toggled-pressed",
"title-1-active",
"title-1-inactive",
"title-2-active",
"title-2-inactive",
"title-3-active",
"title-3-inactive",
"title-4-active",
"title-4-inactive",
"title-5-active",
"title-5-inactive",
"top-left-active",
"top-left-inactive",
"top-right-active",
"top-right-inactive",
"left-active",
"left-inactive",
"right-active",
"right-inactive",
"bottom-active",
"bottom-inactive",
"bottom-left-active",
"bottom-left-inactive",
"bottom-right-active",
"bottom-right-inactive",
]
def subst_text(path, _from, to):
with open(path, "r+") as f:
content = f.read()
f.seek(0)
f.truncate()
f.write(re.sub(_from, to, content))
def generate_for_flavor(flavor: Flavor):
# Setup the palette
palette = flavor.colors
close_color=f'#{palette.red.hex}'
max_color=f'#{palette.green.hex}'
min_color=f'#{palette.yellow.hex}'
# We expand the source assets into the 4 flavors, but need to map between
# Their definition of dark and ours. This means that latte will get the -light assets
# and the rest get the -dark assets to work from
color = "-dark"
if not flavor.dark:
color = "-light"
# Make a directory for our patched SVGs to live in before compilation
odir = f"{THIS_DIR}/patched"
os.makedirs(odir, exist_ok=True)
# Copy the base assets into the output
shutil.copy(
f"{THIS_DIR}/assets{color}.svg",
f"{odir}/assets-catppuccin-{flavor.identifier}.svg",
)
shutil.copy(
f"{THIS_DIR}/assets{color}-normal.svg",
f"{odir}/assets-catppuccin-{flavor.identifier}-normal.svg",
)
# Patch all the SVGs
path = f"{odir}/assets-catppuccin-{flavor.identifier}-normal.svg"
subst_text(path, "#fd5f51", close_color)
subst_text(path, "#38c76a", max_color)
subst_text(path, "#fdbe04", min_color)
headerbar = palette.base.hex
headerbar_backdrop = palette.mantle.hex
if flavor.dark:
path = f"{odir}/assets-catppuccin-{flavor.identifier}.svg"
subst_text(path, "#242424", headerbar)
subst_text(path, "#2c2c2c", headerbar_backdrop)
path = f"{odir}/assets-catppuccin-{flavor.identifier}-normal.svg"
subst_text(path, "#242424", headerbar)
subst_text(path, "#2c2c2c", headerbar_backdrop)
else:
path = f"{odir}/assets-catppuccin-{flavor.identifier}.svg"
subst_text(path, "#f2f2f2", headerbar)
subst_text(path, "#fafafa", headerbar_backdrop)
path = f"{odir}/assets-catppuccin-{flavor.identifier}-normal.svg"
subst_text(path, "#f2f2f2", headerbar)
subst_text(path, "#fafafa", headerbar_backdrop)
@dataclass
class WorkerInput:
output_path: str
output_dir: str
input_path: str
dpi: str
ident: str
def call_subprocesses(inp: WorkerInput):
inkscape = "inkscape"
optipng = "optipng"
return [
subprocess.Popen(
[
# FIXME: https://gitlab.com/inkscape/inkscape/-/issues/4716#note_1882967469Z
"unshare",
"--user",
inkscape,
"--export-id",
inp.ident,
"--export-id-only",
"--export-dpi",
inp.dpi,
"--export-filename",
inp.output_path,
inp.input_path,
],
stdout=subprocess.DEVNULL,
stderr=subprocess.STDOUT,
),
subprocess.Popen(
[optipng, "-o7", "--quiet", inp.output_path],
stdout=subprocess.DEVNULL,
stderr=subprocess.STDOUT,
),
]
@dataclass
class RenderState:
tasks: List[subprocess.Popen]
input_root: str
output_root: str
screen_to_dpi = {
"-hdpi": "144",
"-xhdpi": "192",
}
def render_for_screen(state: RenderState, flavor: Flavor, screen: str, ident: str):
# NOTE: We do not generate for the -normal variant currently, that would just be
# a stupid amount of compute and time for little benefit
src_file = f"{state.input_root}/assets-catppuccin-{flavor.identifier}.svg"
output_dir = f"{state.output_root}/assets-catppuccin-{flavor.identifier}{screen}"
output_path = f"{output_dir}/{ident}.png"
dpi = screen_to_dpi.get(screen, "96")
os.makedirs(output_dir, exist_ok=True)
if os.path.exists(output_path):
print(f"Skipping '{output_path}', already generated")
else:
new_tasks = call_subprocesses(
WorkerInput(
output_path=output_path,
output_dir=output_dir,
input_path=src_file,
dpi=dpi,
ident=ident,
)
)
state.tasks.extend(new_tasks)
def render_for_flavor(flavor: Flavor, state: RenderState):
print(
f"Starting render tasks for {flavor.identifier}"
)
for ident in INDEX:
render_for_screen(state=state, flavor=flavor, screen="", ident=ident)
render_for_screen(state=state, flavor=flavor, screen="-hdpi", ident=ident)
render_for_screen(state=state, flavor=flavor, screen="-xhdpi", ident=ident)
generate_for_flavor(PALETTE.mocha)
generate_for_flavor(PALETTE.latte)
generate_for_flavor(PALETTE.macchiato)
generate_for_flavor(PALETTE.frappe)
state = RenderState(
tasks=[], input_root=f"{THIS_DIR}/patched", output_root=f"{THIS_DIR}/generated"
)
start_time = time.time()
render_for_flavor(PALETTE.mocha, state)
render_for_flavor(PALETTE.latte, state)
render_for_flavor(PALETTE.macchiato, state)
render_for_flavor(PALETTE.frappe, state)
for task in state.tasks:
task.wait()
end_time = time.time() - start_time
print(f"Generation complete in {end_time} seconds")
shutil.rmtree(state.input_root)

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
}
}

View File

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

View File

@@ -1,84 +0,0 @@
import os
import shutil
import subprocess
from typing import List
from scripts.ctp_colors import ctp_colors
from scripts.recolor import recolor
from scripts.utils import zip_multiple_folders
from scripts.var import def_color_map, theme_name, tmp_dir, work_dir
def create_theme(types: List[str], accents: List[str], dest: str = tmp_dir, link: bool = False,
name: str = theme_name, size: str = "standard", tweaks=[], zip = False) -> None:
try:
os.makedirs(dest) # Create our destination directory
except FileExistsError:
pass
for type in types:
for accent in accents:
# Recolor colloid wrt our selection like mocha. latte
print(type, accent)
recolor(ctp_colors[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:
install_cmd += f" --tweaks {' '.join([tweak for tweak in tweaks])}"
os.chdir(work_dir)
# Install the theme globally for you
subprocess.call(install_cmd, shell=True)
# reset colloid repo to original state
subprocess.call("git reset --hard HEAD", shell=True)
try:
# Rename colloid generated files as per catppuccin
new_filename = dest + \
f"/{theme_name}-{type.capitalize()}-{size.capitalize()}-{accent.capitalize()}-{theme_style.title()}"
filename = f"{theme_name}"
if def_color_map[accent] != 'default':
filename += f"-{def_color_map[accent].capitalize()}"
filename += f"-{theme_style.capitalize()}"
if size == 'compact':
filename += '-Compact'
try:
shutil.rmtree(new_filename + '-hdpi')
shutil.rmtree(new_filename + '-xhdpi')
shutil.rmtree(new_filename)
except:
pass
os.rename(dest + "/" + filename + '-hdpi',
new_filename + '-hdpi')
os.rename(dest + "/" + filename + '-xhdpi',
new_filename + '-xhdpi')
os.rename(dest + "/" + filename, new_filename)
print("Successfully renamed file")
except Exception as e:
print("Failed to rename the files due to:", e)
if link:
try:
# Attempte relinking all the libadvaita files
subprocess.call(
'rm -rf "${HOME}/.config/gtk-4.0/"{assets,gtk.css,gtk-dark.css}', shell=True)
HOME = os.path.expanduser('~')
try:
os.makedirs(f"{HOME}/.config/gtk-4.0")
except FileExistsError:
pass
os.symlink(f"{new_filename}/gtk-4.0/assets",
f"{HOME}/.config/gtk-4.0/assets")
os.symlink(f"{new_filename}/gtk-4.0/gtk.css",
f"{HOME}/.config/gtk-4.0/gtk.css")
os.symlink(f"{new_filename}/gtk-4.0/gtk-dark.css",
f"{HOME}/.config/gtk-4.0/gtk-dark.css")
print("Successfully created symlinks for libadvaita")
except Exception as e:
print("Failed to link due to :", e)
if zip:
foldernames = [new_filename, new_filename + '-xhdpi', new_filename + '-hdpi']
zip_multiple_folders(foldernames, new_filename + ".zip", not link)

View File

@@ -1,16 +0,0 @@
from catppuccin import Flavour
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

View File

@@ -1,141 +0,0 @@
from catppuccin import Flavour
from .utils import replacetext
from .var import (def_accent_dark, def_accent_light, def_color_map, src_dir,
theme_name, work_dir)
def recolor_accent(flavor, file: str, accent: str = "blue"):
"""
Recolors the accent color in a file.
flavor:
The flavor to recolor to. Like mocha, frappe, latte, etc.
file:
The file to modify
accent:
The accent color to replace. Defaults to Blue
"""
print(f"Recoloring accent for {file}...")
# Recolor as per accent for light. Hard code it as latte
for key, value in Flavour.latte().__dict__.items():
if key == accent:
replacetext(
file, def_accent_light[def_color_map[accent]], value.hex)
# Recolor as per base for dark theme.
for key, value in flavor.__dict__.items():
if key == accent:
replacetext(
file, def_accent_dark[def_color_map[accent]], value.hex)
def recolor(flavor, accent: str):
"""
Recolor the theme. currently hard code it frappe
"""
print("Recoloring to suit catppuccin theme")
replacetext(f"{work_dir}/install.sh", "Colloid", theme_name)
print("MOD: Gtkrc.sh")
# Recolor as per accent for dark
recolor_accent(flavor, f"{work_dir}/gtkrc.sh", accent)
replacetext(f"{work_dir}/gtkrc.sh", "background_light='#FFFFFF'",
f"background_light='#{Flavour.latte().base.hex}'") # use latte_base for background_light
replacetext(f"{work_dir}/gtkrc.sh", "background_dark='#0F0F0F'",
f"background_dark='#{flavor.base.hex}'")
replacetext(f"{work_dir}/gtkrc.sh", "background_darker='#121212'",
f"background_darker='#{flavor.mantle.hex}'")
replacetext(f"{work_dir}/gtkrc.sh",
"background_alt='#212121'", f"background_alt='#{flavor.crust.hex}'")
replacetext(f"{work_dir}/gtkrc.sh", "titlebar_light='#F2F2F2'",
f"titlebar_light='#{Flavour.latte().crust.hex}'") # use latte_crust for titlebar_light
replacetext(f"{work_dir}/gtkrc.sh", "titlebar_dark='#030303'",
f"titlebar_dark='#{flavor.crust.hex}'")
replacetext(f"{work_dir}/gtkrc.sh", "background_dark='#2C2C2C'",
f"background_dark='#{flavor.base.hex}'")
replacetext(f"{work_dir}/gtkrc.sh", "background_darker='#3C3C3C'",
f"background_darker='#{flavor.mantle.hex}'")
replacetext(f"{work_dir}/gtkrc.sh",
"background_alt='#464646'", f"background_alt='#{flavor.crust.hex}'")
replacetext(f"{work_dir}/gtkrc.sh",
"titlebar_light='#F2F2F2'", f"titlebar_light='#{Flavour.latte().crust.hex}'")
replacetext(f"{work_dir}/gtkrc.sh",
"titlebar_dark='#242424'", f"titlebar_dark='#{flavor.crust.hex}'")
print("Mod SASS Color_Palette_default")
recolor_accent(
flavor, f"{src_dir}/sass/_color-palette-default.scss", accent)
# Greys
if flavor == Flavour.latte(): # Hardcode till someone smarter than me comes along
replacetext(f"{src_dir}/sass/_color-palette-default.scss",
"grey-050: #FAFAFA", f"grey-050: #{flavor.crust.hex}")
replacetext(f"{src_dir}/sass/_color-palette-default.scss",
"grey-100: #F2F2F2", f"grey-100: #{flavor.mantle.hex}")
replacetext(f"{src_dir}/sass/_color-palette-default.scss",
"grey-150: #EEEEEE", f"grey-150: #{flavor.base.hex}")
replacetext(f"{src_dir}/sass/_color-palette-default.scss",
"grey-200: #DDDDDD", f"grey-200: #{flavor.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
replacetext(f"{src_dir}/sass/_color-palette-default.scss",
"grey-650: #3C3C3C", f"grey-650: #{Flavour.mocha().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
replacetext(f"{src_dir}/sass/_color-palette-default.scss",
"grey-750: #242424", f"grey-750: #{Flavour.mocha().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
replacetext(f"{src_dir}/sass/_color-palette-default.scss",
"grey-850: #121212", f"grey-850: #{Flavour.mocha().surface1.hex}") # H Darknes
replacetext(f"{src_dir}/sass/_color-palette-default.scss",
"grey-900: #0F0F0F", f"grey-900: #{Flavour.mocha().base.hex}") # G Darknes
replacetext(f"{src_dir}/sass/_color-palette-default.scss",
"grey-950: #030303", f"grey-950: #{Flavour.mocha().crust.hex}") # F Darknes
else:
replacetext(f"{src_dir}/sass/_color-palette-default.scss",
"grey-050: #FAFAFA", f"grey-050: #{flavor.overlay2.hex}")
replacetext(f"{src_dir}/sass/_color-palette-default.scss",
"grey-100: #F2F2F2", f"grey-100: #{flavor.overlay1.hex}")
replacetext(f"{src_dir}/sass/_color-palette-default.scss",
"grey-150: #EEEEEE", f"grey-150: #{flavor.overlay0.hex}")
replacetext(f"{src_dir}/sass/_color-palette-default.scss",
"grey-200: #DDDDDD", f"grey-200: #{flavor.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
replacetext(f"{src_dir}/sass/_color-palette-default.scss",
"grey-650: #3C3C3C", f"grey-650: #{flavor.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
replacetext(f"{src_dir}/sass/_color-palette-default.scss",
"grey-750: #242424", f"grey-750: #{flavor.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
replacetext(f"{src_dir}/sass/_color-palette-default.scss",
"grey-850: #121212", f"grey-850: #{flavor.surface1.hex}") # H Darknes
replacetext(f"{src_dir}/sass/_color-palette-default.scss",
"grey-900: #0F0F0F", f"grey-900: #{flavor.base.hex}") # G Darknes
replacetext(f"{src_dir}/sass/_color-palette-default.scss",
"grey-950: #030303", f"grey-950: #{flavor.crust.hex}") # F Darknes
# Buttons
replacetext(f"{src_dir}/sass/_color-palette-default.scss",
"button-close: #fd5f51", f"button-close: #{flavor.red.hex}")
replacetext(f"{src_dir}/sass/_color-palette-default.scss",
"button-max: #38c76a", f"button-max: #{flavor.green.hex}")
replacetext(f"{src_dir}/sass/_color-palette-default.scss",
"button-min: #fdbe04", f"button-min: #{flavor.yellow.hex}")
print("Mod Accent Cinnamon")
recolor_accent(flavor, f"{src_dir}/assets/cinnamon/make-assets.sh", accent)
print("Mod Accent Gnome shell")
recolor_accent(
flavor, f"{src_dir}/assets/gnome-shell/make-assets.sh", accent)
print("Mod Accent GTK")
recolor_accent(flavor, f"{src_dir}/assets/gtk/make-assets.sh", accent)
print("Mod Accent GTK 2.0")
recolor_accent(flavor, f"{src_dir}/assets/gtk-2.0/make-assets.sh", accent)

View File

@@ -1,47 +0,0 @@
import os
import re
import shutil
import zipfile
def replacetext(file_name: str, search_text: str, replace_text: str) -> None:
"""
Helper function to replace the color in the file.
Can be used to replace any text in the file.
Args:
file_name (str): The file to replace the text in.
search_text (str): The text to be replaced.
replace_text (str): The text to replace with.
Returns:
None
"""
with open(file_name, 'r+') as f:
file = f.read()
file = re.sub(search_text, replace_text, file)
f.seek(0)
f.write(file)
f.truncate()
def zipdir(path, ziph):
"""
Takes in a oath of a directory and zips it in a ziph.
Util to zip a directory.
Thanks https://stackoverflow.com/questions/46229764/python-zip-multiple-directories-into-one-zip-file
"""
for root, _, files in os.walk(path):
for file in files:
ziph.write(os.path.join(root, file),
os.path.relpath(os.path.join(root, file),
os.path.join(path, '..')))
def zip_multiple_folders(dir_list, zip_name, remove = True):
zipf = zipfile.ZipFile(zip_name, 'w', zipfile.ZIP_DEFLATED)
for dir in dir_list:
zipdir(dir, zipf)
if remove:
shutil.rmtree(dir)
zipf.close()

View File

@@ -1,50 +0,0 @@
import os
repo_dir = os.getcwd()
work_dir = f"{repo_dir}/colloid"
src_dir = f"{work_dir}/src"
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 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 = {
'rosewater': 'pink',
'flamingo': 'pink',
'pink': 'pink',
'mauve': 'purple',
'red': 'red',
'maroon': 'red',
'peach': 'orange',
'yellow': 'yellow',
'green': 'green',
'teal': 'teal',
'sky': 'teal',
'sapphire': 'default',
'blue': 'default',
'lavender': 'default'}
def_accent_light = {
'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'
}

13
shell.nix Normal file
View File

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