Compare commits

...

75 Commits

Author SHA1 Message Date
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
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
spooky
20291d1423 fix: pop quick launcher hover text color for dark themes 2022-12-12 08:39:54 +05:30
Soumik
2f7fe319f3 fix: quick launcher hover text color for dark themes 2022-12-12 04:31:56 +05:30
Isabel
5de6830cdb docs: new screenshot! 2022-12-10 22:54:28 -08:00
Himanshu
fd36189601 docs(README): reword 'thanks to' section 2022-12-11 12:21:25 +05:30
31 changed files with 23576 additions and 4884 deletions

33
.github/ISSUE_TEMPLATE/bug-report.md vendored Normal file
View File

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

View File

@@ -20,8 +20,10 @@ jobs:
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 ./install.py all -a all --zip -d $PWD/releases --recreate-asset
- name: Add zips to release
uses: softprops/action-gh-release@v1
with:

7
.gitignore vendored
View File

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

230
README.md
View File

@@ -12,7 +12,7 @@
</p>
<p align="center">
<img src="https://raw.githubusercontent.com/catppuccin/gtk/main/assets/demo2.png"/>
<img src="assets/res.webp"/>
</p>
# About
@@ -23,76 +23,236 @@ This GTK theme is based on the [Colloid](https://github.com/vinceliuice/Colloid-
### Requirements
- GTK `>=3.20`
- `gnome-themes-extra` (or `gnome-themes-standard`)
- Murrine engine
- GTK `>=3.20`
- `gnome-themes-extra` (or `gnome-themes-standard`)
### Installation
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)
1. Download and extract the theme zip from [releases](https://github.com/catppuccin/gtk/releases/).
2. Move the theme folder to **".themes"** in your home directory. **(~/.themes)** (Skip this step if you are using the AUR package)
3. Select **"Catppuccin-Flavour** or **Catppuccin-Flavour-Color"** via your desktop specific tweaks application (**gnome-tweaks** on Gnome3+).
### 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/)
3. Select the downloaded theme via your desktop specific tweaks application (**gnome-tweaks** on Gnome 3+).
### 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
```
## Development
**Note**: Ensure that you have atleast python version 3.10 installed
```bash
yay -S catppuccin-gtk-theme-mocha catppuccin-gtk-theme-macchiato catppuccin-gtk-theme-frappe catppuccin-gtk-theme-latte
```
### For Nix users
The [catppuccin-gtk](https://github.com/NixOS/nixpkgs/blob/master/pkgs/data/themes/catppuccin-gtk/default.nix) package in Nixpkgs allows you to specify the accents, size, tweaks and variant (flavour) of the theme by overriding the package.
By default, the variant is `frappe`, the accent is `blue`, the size is `standard`, and no tweaks are enabled. To change them, override the package. A list of valid choices are available in the package definition [here](https://github.com/NixOS/nixpkgs/blob/7ce8e7c4cf90492a631e96bcfe70724104914381/pkgs/data/themes/catppuccin-gtk/default.nix#L16).
Example:
```nix
# as per wiki examples
environment.systemPackages = with pkgs; [
...
(catppuccin-gtk.override {
accents = [ "pink" ]; # You can specify multiple accents here to output multiple themes
size = "compact";
tweaks = [ "rimless" "black" ]; # You can also specify multiple tweaks here
variant = "macchiato";
})
...
];
```
To use it in home-manager:
```nix
# home.nix
{
pkgs,
...
}: {
gtk = {
enable = true;
theme = {
name = "Catppuccin-Macchiato-Compact-Pink-Dark";
package = pkgs.catppuccin-gtk.override {
accents = [ "pink" ];
size = "compact";
tweaks = [ "rimless" "black" ];
variant = "macchiato";
};
};
};
}
# Now symlink the `~/.config/gtk-4.0/` folder declaratively:
xdg.configFile = {
"gtk-4.0/assets".source = "${config.gtk.theme.package}/share/themes/${config.gtk.theme.name}/gtk-4.0/assets";
"gtk-4.0/gtk.css".source = "${config.gtk.theme.package}/share/themes/${config.gtk.theme.name}/gtk-4.0/gtk.css";
"gtk-4.0/gtk-dark.css".source = "${config.gtk.theme.package}/share/themes/${config.gtk.theme.name}/gtk-4.0/gtk-dark.css";
};
```
### For GTK 4 users
To theme GTK 4 applications you have to manually symlink the `~/.config/gtk-4.0/` to the themes folder. Use the following commands
```bash
mkdir -p "${HOME}/.config/gtk-4.0"
ln -sf "${THEME_DIR}/gtk-4.0/assets" "${HOME}/.config/gtk-4.0/assets"
ln -sf "${THEME_DIR}/gtk-4.0/gtk.css" "${HOME}/.config/gtk-4.0/gtk.css"
ln -sf "${THEME_DIR}/gtk-4.0/gtk-dark.css" "${HOME}/.config/gtk-4.0/gtk-dark.css"
```
### For Flatpak users
1. To give your Flatpaks access to your themes folder run:
```bash
sudo flatpak override --filesystem=$HOME/.themes
```
2. To set the theme for all Flatpaks, replace `##theme##` with the name of the theme you want to use and run this command:
```bash
sudo flatpak override --env=GTK_THEME=##theme##
```
3. For a more in depth tutorial see Hamza Algohary's tutorial on [It's FOSS](https://itsfoss.com/flatpak-app-apply-theme/)
### Handling GTK theme installation from window manager
1. Install unzip and curl.
2. Go to your window manager config file.
3. Add an entrance to the config file to be executed when your window manager is loaded.
- i3/sway example:
```
# catppuccin
set $ctp-version v0.6.1
exec_always if [ ! -e ~/.themes/Catppuccin-Frappe-Standard-Lavender-dark ]; then \
mkdir -p ~/.themes \
&& curl -L https://github.com/catppuccin/gtk/releases/download/$ctp-version/Catppuccin-Frappe-Standard-Lavender-dark.zip -o ~/.themes/catppuccin.zip \
&& unzip ~/.themes/catppuccin.zip -d ~/.themes/ \
&& rm -rf ~/.themes/catppuccin.zip; fi
```
> Note: The previous example execute that script every time i3/sway is reloaded.
4. Set the GTK_THEME environment variable:
```sh
export GTK_THEME='Catppuccin-Frappe-Standard-Lavender-dark:dark'
```
> [!NOTE]
> in order to update the theme's version, just change the variable `$ctp-version`.
### GDM Theme
> [!WARNING]
> Applying a custom theme to GDM is not recommended as it is not themeable, however you can do it through certain *hacks*.
To apply the theme to GDM, A new `gnome-shell-theme.gresource.xml` needs to be complied.
To achieve this, you can run the following:
```bash
# Backup the current gresource file.
sudo cp -av /usr/share/gnome-shell/gnome-shell-theme.gresource{,~}
sudo glib-compile-resources --target="/usr/share/gnome-shell/gnome-shell-theme.gresource" --sourcedir="$THEME_DIR" "$THEME_DIR/gnome-shell-theme.gresource.xml"
```
Make sure to replace `$THEME_DIR` to where the theme was extracted accordingly.
- For nix users, it'll be the nix store path of the package.
- For AUR users, it'll be in `~/.themes`
- Otherwise, it'll be wherever you extracted the theme.
### Using the script
**Note**: Ensure that you have at least Python version 3.10 installed
Set up the installer using
Clone the repository using
```bash
git clone --recurse-submodules git@github.com:catppuccin/gtk.git
cd gtk
virtualenv -p python3 venv # to be created only once and only if you need a virtual env
source venv/bin/activate
source venv/bin/activate
pip install -r requirements.txt
```
To check out the install script, run
To check out the install script, run
```bash
python install.py --help
```
> Tip: `python install.py --help` allows the following options:
```
Compulsory field Specify color variant(s) [mocha|frappe|macchiato|latte|all]
-d, --dest DIR Specify destination directory (Default: ~/.themes)
-n, --name NAME Specify theme name (Default: Colloid)
-a, --accent VARIANT... Specify theme color variant(s) [rosewater|flamingo|pink|mauve|red|maroon|peach|yellow|green|teal|sky|
sapphire|blue|lavender|all] (Default: blue)
-s, --size VARIANT... Specify size variant [standard|compact] (Default: standard variant)
-l, --link Link installed gtk-4.0 theme to config folder for all libadwaita app use this theme
--zip Zips up the finally produced themes.
--tweaks Specify versions for tweaks [black|rimless|normal|float]
1. black: Blackness color version
2. rimless: Remove the 1px border about windows and menus
3. normal: Normal windows button style (titlebuttons: max/min/close)
4. float: Floating gnome-shell panel style
-h, --help Show help
```
You can install any theme like the following example
```bash
python install.py mocha -a sky --tweaks rimless -d ~/.themes
```
You can build all possible variations of the theme possible using the following command and it will output it to releases folder in the root of the repo.
You can build all possible variations of the theme possible using the following command and it will install it to releases folder
```bash
python build.py
python install.py all -a all
```
## Development
You need to install the following packages to build the theme. Check with your distribution for the package names in the repository
- `sassc`
- `inkscape`
- `optipng`
A few important notes to keep in mind
* `recolor.py` handles all changes that needs to be done to colloid to ensure it generated catppuccin colors. If vinceliuice changes anything in his theme in future, that is where you must change
* `var.py` includes all different variables that you can tinker around as per your personal requirements.
* `create_theme.py` consists of a wrapper that will recolor the colloid theme, install it as per the args provided and rename it accordingly.
- `recolor.py` handles all changes that needs to be done to colloid to ensure it generated catppuccin colors. If vinceliuice changes anything in his theme in future, that is where you must change
- `var.py` includes all different variables that you can tinker around as per your personal requirements.
- `create_theme.py` consists of a wrapper that will recolor the colloid theme, install it as per the args provided and rename it accordingly.
## 💝 Thanks to
- [sadrach-cl](https://github.com/sadrach-cl)
- [npv12](https://github.com/npv12)
**Current maintainers**
- [npv12](https://github.com/npv12)
- [ghostx31](https://github.com/ghostx31)
- [Syndrizzle](https://github.com/Syndrizzle)
**Contributions**
- [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

BIN
assets/res.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 108 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 922 KiB

Submodule colloid updated: 5b08fdbf1c...6cf7ea0237

View File

@@ -6,10 +6,12 @@ Usage:
python install.py [options]
"""
import argparse
import os
import subprocess
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
from scripts.var import theme_name, work_dir
parser = argparse.ArgumentParser(description="Catppuccin theme")
parser.add_argument("flavor",
@@ -29,7 +31,6 @@ parser.add_argument("--name", "-n",
parser.add_argument("--dest", "-d",
metavar="destination",
type=str,
default=tmp_dir,
dest="dest",
help="Destination of the files. defaults to releases folder inside the root")
@@ -58,7 +59,7 @@ parser.add_argument("--tweaks",
default=[],
nargs="+",
dest="tweaks",
choices=["black", "rimless", "normal"],
choices=["black", "rimless", "normal", "float"],
help="Some specifc tweaks. like black, rimless, normal buttons")
parser.add_argument("-l", "--link",
@@ -75,6 +76,13 @@ parser.add_argument("--zip",
action=argparse.BooleanOptionalAction,
dest="zip")
parser.add_argument("--recreate-asset",
help="Recreate assets for xfwm4 and such",
type=bool,
default=False,
action=argparse.BooleanOptionalAction,
dest="rec_asset")
args = parser.parse_args()
if "all" in args.flavor:
@@ -87,5 +95,15 @@ if "all" in args.accent:
else:
accents = args.accent
filename = create_theme(flavors, accents, args.dest,
args.link, args.name, args.size, args.tweaks, args.zip)
if args.dest:
dest = args.dest
elif os.geteuid() == 0: # Sudo
dest = "/usr/share/themes"
else:
dest = os.path.expanduser('~') + "/.themes"
if not os.listdir(work_dir):
subprocess.call("git submodule update --init --recursive", shell=True)
filename = create_theme(flavors, accents, dest,
args.link, args.name, args.size, args.tweaks, args.zip, args.rec_asset)

File diff suppressed because it is too large Load Diff

After

Width:  |  Height:  |  Size: 60 KiB

File diff suppressed because it is too large Load Diff

After

Width:  |  Height:  |  Size: 49 KiB

File diff suppressed because it is too large Load Diff

After

Width:  |  Height:  |  Size: 60 KiB

File diff suppressed because it is too large Load Diff

After

Width:  |  Height:  |  Size: 49 KiB

File diff suppressed because it is too large Load Diff

After

Width:  |  Height:  |  Size: 60 KiB

File diff suppressed because it is too large Load Diff

After

Width:  |  Height:  |  Size: 49 KiB

File diff suppressed because it is too large Load Diff

After

Width:  |  Height:  |  Size: 60 KiB

File diff suppressed because it is too large Load Diff

After

Width:  |  Height:  |  Size: 49 KiB

File diff suppressed because it is too large Load Diff

After

Width:  |  Height:  |  Size: 60 KiB

File diff suppressed because it is too large Load Diff

After

Width:  |  Height:  |  Size: 49 KiB

File diff suppressed because it is too large Load Diff

After

Width:  |  Height:  |  Size: 60 KiB

File diff suppressed because it is too large Load Diff

After

Width:  |  Height:  |  Size: 49 KiB

File diff suppressed because it is too large Load Diff

After

Width:  |  Height:  |  Size: 60 KiB

File diff suppressed because it is too large Load Diff

After

Width:  |  Height:  |  Size: 49 KiB

File diff suppressed because it is too large Load Diff

After

Width:  |  Height:  |  Size: 60 KiB

File diff suppressed because it is too large Load Diff

After

Width:  |  Height:  |  Size: 49 KiB

View File

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

View File

@@ -4,13 +4,14 @@ import subprocess
from typing import List
from scripts.ctp_colors import ctp_colors
from scripts.patches import recreate_xfwm4_assets
from scripts.recolor import recolor
from scripts.utils import zip_multiple_folders
from scripts.var import def_color_map, theme_name, tmp_dir, work_dir
from scripts.utils import replacetext, zip_multiple_folders
from scripts.var import def_color_map, repo_dir, src_dir, theme_name, work_dir
def create_theme(types: List[str], accents: List[str], dest: str = tmp_dir, link: bool = False,
name: str = theme_name, size: str = "standard", tweaks=[], zip = False) -> None:
def create_theme(types: List[str], accents: List[str], dest: str, link: bool = False,
name: str = theme_name, size: str = "standard", tweaks=[], zip = False, recreate_assets = False) -> None:
try:
os.makedirs(dest) # Create our destination directory
@@ -18,26 +19,28 @@ def create_theme(types: List[str], accents: List[str], dest: str = tmp_dir, link
pass
for type in types:
if recreate_assets:
recreate_xfwm4_assets(type)
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])}"
shutil.rmtree(f"{repo_dir}/chrome", ignore_errors=True)
shutil.copytree(f"{src_dir}/other/firefox/chrome", f"{repo_dir}/chrome")
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)
subprocess.call("./build.sh", shell=True) # Rebuild all scss
subprocess.call(install_cmd, shell=True) # Install the theme globally for you
subprocess.call("git reset --hard HEAD", shell=True) # reset colloid repo to original state
try:
# Rename colloid generated files as per catppuccin
new_filename = dest + \
f"/{theme_name}-{type.capitalize()}-{size.capitalize()}-{accent.capitalize()}"
filename = f"{theme_name}"
f"/{name}-{type.capitalize()}-{size.capitalize()}-{accent.capitalize()}-{theme_style.title()}"
filename = f"{name}"
if def_color_map[accent] != 'default':
filename += f"-{def_color_map[accent].capitalize()}"
filename += f"-{theme_style.capitalize()}"
@@ -54,6 +57,7 @@ def create_theme(types: List[str], accents: List[str], dest: str = tmp_dir, link
os.rename(dest + "/" + filename + '-xhdpi',
new_filename + '-xhdpi')
os.rename(dest + "/" + filename, new_filename)
replacetext(new_filename + '/index.theme', filename, new_filename.split("/")[-1])
print("Successfully renamed file")
except Exception as e:
print("Failed to rename the files due to:", e)

32
scripts/patches.py Normal file
View File

@@ -0,0 +1,32 @@
import os
import shutil
import subprocess
from scripts.var import src_dir, repo_dir, work_dir
def recreate_xfwm4_assets(flavour):
"""
Recolors xfwm4 assets based on the flavour
Args:
flavour (Flavour): The flavour to recolor
"""
# Delete assets that already exists and copy new assets file
folders = ["assets", "assets-Light"]
variants = ["", "-Normal"]
sizes = ["", "-hdpi", "-xhdpi"]
assets_folder = f"{src_dir}/assets/xfwm4"
for folder in folders:
for variant in variants:
for size in sizes:
shutil.rmtree(f"{assets_folder}/{folder}{variant}{size}", ignore_errors=True)
patched_asset = f"{repo_dir}/patches/xfwm4/{folder}-Catppuccin-{flavour}{variant}.svg"
shutil.copy(patched_asset, f"{assets_folder}/{folder}{variant}.svg")
os.chdir(assets_folder)
subprocess.call(f"{assets_folder}/render-assets.sh", shell=True) # Rebuild all assets
os.chdir(work_dir)

View File

@@ -1,71 +1,124 @@
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)
from .utils import replacetext, replaceAllText
from .var import (def_accent_dark, def_accent_light, def_color_map, src_dir, work_dir)
def recolor_accent(flavor, file: str, accent: str = "blue"):
def recolor_accent(flavor, 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)
print(f"Recoloring all accents")
replaceAllText( # Recolor as per base for dark theme.
work_dir, def_accent_dark[def_color_map[accent]], flavor.__dict__[accent].hex)
replaceAllText( # Recolor as per accent for light. Hard code it as latte
work_dir, def_accent_light[def_color_map[accent]], Flavour.latte().__dict__[accent].hex)
# 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_firefox(flavor, accent: str = "blue"):
"""
Recolor the custom gnomish firefox to catpuccin color
"""
firefox_color_file_dark = f"{src_dir}/other/firefox/chrome/Colloid/colors/dark.css"
firefox_color_file_light = f"{src_dir}/other/firefox/chrome/Colloid/colors/light.css"
replacetext(firefox_color_file_light, "2e3436", flavor.base.hex)
replacetext(firefox_color_file_light, "fafafa", Flavour.latte().base.hex)
replacetext(firefox_color_file_light, "f2f2f2", flavor.crust.hex)
replacetext(firefox_color_file_light, "303030", Flavour.mocha().base.hex)
replacetext(firefox_color_file_light, "ffffff", flavor.base.hex)
replacetext(firefox_color_file_light, "5b9bf8", flavor.surface0.hex)
replacetext(firefox_color_file_light, "3c84f7", flavor.__dict__[accent].hex)
replacetext(firefox_color_file_light, "dedede", flavor.surface1.hex)
replacetext(firefox_color_file_light, "f0f0f0", flavor.surface0.hex)
replacetext(firefox_color_file_light, "FAFAFA", flavor.surface1.hex)
replacetext(firefox_color_file_light, "fafafa", flavor.surface0.hex)
replacetext(firefox_color_file_light, "323232", flavor.mantle.hex)
replacetext(firefox_color_file_light, "d5d0cc", flavor.subtext1.hex)
# Buttons
replacetext(firefox_color_file_light, "fd5f51", flavor.red.hex)
replacetext(firefox_color_file_light, "38c76a", flavor.green.hex)
replacetext(firefox_color_file_light, "fdbe04", flavor.yellow.hex)
# Dark
replacetext(firefox_color_file_dark, "eeeeee", flavor.base.hex)
replacetext(firefox_color_file_dark, "2c2c2c", Flavour.mocha().base.hex)
replacetext(firefox_color_file_dark, "242424", flavor.crust.hex)
replacetext(firefox_color_file_dark, "ffffff", Flavour.latte().base.hex)
replacetext(firefox_color_file_dark, "383838", flavor.base.hex)
replacetext(firefox_color_file_dark, "3584e4", flavor.surface0.hex)
replacetext(firefox_color_file_dark, "78aeed", flavor.__dict__[accent].hex)
replacetext(firefox_color_file_dark, "363636", flavor.surface1.hex)
replacetext(firefox_color_file_dark, "404040", flavor.surface0.hex)
replacetext(firefox_color_file_dark, "4F4F4F", flavor.surface1.hex)
replacetext(firefox_color_file_dark, "444444", flavor.surface0.hex)
replacetext(firefox_color_file_dark, "323232", flavor.mantle.hex)
replacetext(firefox_color_file_dark, "919191", flavor.subtext1.hex)
# Buttons
replacetext(firefox_color_file_dark, "fd5f51", flavor.red.hex)
replacetext(firefox_color_file_dark, "38c76a", flavor.green.hex)
replacetext(firefox_color_file_dark, "fdbe04", flavor.yellow.hex)
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("Recoloring accents")
recolor_accent(flavor, accent)
print("Recoloring firefox")
recolor_firefox(flavor, accent)
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}'")
if flavor == Flavour.latte():
replacetext(f"{work_dir}/gtkrc.sh", "background_dark='#0F0F0F'",
f"background_dark='#{Flavour.mocha().base.hex}'")
replacetext(f"{work_dir}/gtkrc.sh", "background_darker='#121212'",
f"background_darker='#{Flavour.mocha().mantle.hex}'")
replacetext(f"{work_dir}/gtkrc.sh",
"background_alt='#212121'", f"background_alt='#{Flavour.mocha().crust.hex}'")
replacetext(f"{work_dir}/gtkrc.sh", "titlebar_dark='#030303'",
f"titlebar_dark='#{Flavour.mocha().crust.hex}'")
replacetext(f"{work_dir}/gtkrc.sh", "background_dark='#2C2C2C'",
f"background_dark='#{Flavour.mocha().base.hex}'")
replacetext(f"{work_dir}/gtkrc.sh", "background_darker='#3C3C3C'",
f"background_darker='#{Flavour.mocha().mantle.hex}'")
replacetext(f"{work_dir}/gtkrc.sh",
"background_alt='#464646'", f"background_alt='#{Flavour.mocha().crust.hex}'")
replacetext(f"{work_dir}/gtkrc.sh",
"titlebar_dark='#242424'", f"titlebar_dark='#{Flavour.mocha().crust.hex}'")
else:
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_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_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
@@ -88,11 +141,11 @@ def recolor(flavor, accent: str):
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
"grey-850: #121212", f"grey-850: #020202") # H Darknes
replacetext(f"{src_dir}/sass/_color-palette-default.scss",
"grey-900: #0F0F0F", f"grey-900: #{Flavour.mocha().base.hex}") # G Darknes
"grey-900: #0F0F0F", f"grey-900: #010101") # G Darknes
replacetext(f"{src_dir}/sass/_color-palette-default.scss",
"grey-950: #030303", f"grey-950: #{Flavour.mocha().crust.hex}") # F Darknes
"grey-950: #030303", f"grey-950: #000000") # F Darknes
else:
replacetext(f"{src_dir}/sass/_color-palette-default.scss",
"grey-050: #FAFAFA", f"grey-050: #{flavor.overlay2.hex}")
@@ -113,11 +166,17 @@ def recolor(flavor, accent: str):
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
"grey-850: #121212", f"grey-850: #020202") # H Darknes
replacetext(f"{src_dir}/sass/_color-palette-default.scss",
"grey-900: #0F0F0F", f"grey-900: #{flavor.base.hex}") # G Darknes
"grey-900: #0F0F0F", f"grey-900: #010101") # G Darknes
replacetext(f"{src_dir}/sass/_color-palette-default.scss",
"grey-950: #030303", f"grey-950: #{flavor.crust.hex}") # F Darknes
"grey-950: #030303", f"grey-950: #000000") # F Darknes
# Make the hover black
replacetext(f"{src_dir}/sass/gtk/_common-3.0.scss",
"if\(\$colorscheme != 'dracula', white, rgba\(black, 0\.5\)\)", "rgba(black, 0.5)")
replacetext(f"{src_dir}/sass/gtk/_common-4.0.scss",
"if\(\$colorscheme != 'dracula', white, rgba\(black, 0\.5\)\)", "rgba(black, 0.5)")
# Buttons
replacetext(f"{src_dir}/sass/_color-palette-default.scss",
@@ -126,16 +185,3 @@ def recolor(flavor, accent: str):
"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

@@ -4,25 +4,38 @@ import shutil
import zipfile
def replacetext(file_name: str, search_text: str, replace_text: str) -> None:
def replacetext(filepath: 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.
filepath (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()
try:
with open(filepath, 'r+') as f:
file = f.read()
file = re.sub(search_text, replace_text, file)
f.seek(0)
f.write(file)
f.truncate()
except Exception:
print(f"Failed to recolor {filepath}")
def replaceAllText(start_dir: str, search_text: str, replace_text: str) -> None:
for path, _, files in os.walk(os.path.abspath(start_dir)):
for filename in files:
filepath = os.path.join(path, filename)
if filepath.endswith(".png"):
continue
replacetext(filepath, search_text, replace_text)
def zipdir(path, ziph):
@@ -38,7 +51,7 @@ def zipdir(path, ziph):
os.path.join(path, '..')))
def zip_multiple_folders(dir_list, zip_name, remove = True):
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)