Compare commits

..

12 Commits

Author SHA1 Message Date
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
25 changed files with 23260 additions and 10 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.

3
.gitignore vendored
View File

@@ -2,7 +2,8 @@ pkgs/
*-temp.scss *-temp.scss
__pycache__ __pycache__
venv/ venv/
.venv
# Releases folder # Releases folder
releases releases
chrome chrome

View File

@@ -45,11 +45,47 @@ With your favourite AUR helper, install them:
```bash ```bash
yay -S catppuccin-gtk-theme-mocha catppuccin-gtk-theme-macchiato catppuccin-gtk-theme-frappe catppuccin-gtk-theme-latte yay -S catppuccin-gtk-theme-mocha catppuccin-gtk-theme-macchiato catppuccin-gtk-theme-frappe catppuccin-gtk-theme-latte
``` ```
### For Nix users
The [catppuccin-gtk](https://github.com/NixOS/nixpkgs/blob/master/pkgs/data/themes/catppuccin-gtk/default.nix) package in Nixpkgs allows you to specify the accents, size, tweaks and variant (flavour) of the theme by overriding the package.
By default, the variant is `frappe`, the accent is `blue`, the size is `standard`, and no tweaks are enabled. To change them, override the package. A list of valid choices are available in the package definition [here](https://github.com/NixOS/nixpkgs/blob/7ce8e7c4cf90492a631e96bcfe70724104914381/pkgs/data/themes/catppuccin-gtk/default.nix#L16).
Example:
```nix
pkgs.catppuccin-gtk.override {
accents = [ "pink" ]; # You can specify multiple accents here to output multiple themes
size = "compact";
tweaks = [ "rimless" "black" ]; # You can also specify multiple tweaks here
variant = "macchiato";
}
```
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";
};
};
};
}
```
### For gtk-4.0 users ### For gtk-4.0 users
To theme gtk-4.0 applications you have to manually symlink the `~/.config/gtk-4.0/` to the themes folder. Use the following commands To theme gtk-4.0 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" 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/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.css" "${HOME}/.config/gtk-4.0/gtk.css"

Submodule colloid updated: d8f0fbe207...6ddd8e1932

View File

@@ -76,6 +76,13 @@ parser.add_argument("--zip",
action=argparse.BooleanOptionalAction, action=argparse.BooleanOptionalAction,
dest="zip") dest="zip")
parser.add_argument("--recreate-asset",
help="Recreate assets for xfwm4 and such",
type=bool,
default=True,
action=argparse.BooleanOptionalAction,
dest="rec_asset")
args = parser.parse_args() args = parser.parse_args()
if "all" in args.flavor: if "all" in args.flavor:
@@ -99,4 +106,4 @@ if not os.listdir(work_dir):
subprocess.call("git submodule update --init --recursive", shell=True) subprocess.call("git submodule update --init --recursive", shell=True)
filename = create_theme(flavors, accents, dest, filename = create_theme(flavors, accents, dest,
args.link, args.name, args.size, args.tweaks, args.zip) 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

@@ -4,13 +4,14 @@ import subprocess
from typing import List from typing import List
from scripts.ctp_colors import ctp_colors from scripts.ctp_colors import ctp_colors
from scripts.patches import recreate_xfwm4_assets
from scripts.recolor import recolor from scripts.recolor import recolor
from scripts.utils import zip_multiple_folders from scripts.utils import zip_multiple_folders
from scripts.var import def_color_map, repo_dir, src_dir, theme_name, work_dir from scripts.var import def_color_map, repo_dir, src_dir, theme_name, work_dir
def create_theme(types: List[str], accents: List[str], dest: str, link: bool = False, def create_theme(types: List[str], accents: List[str], dest: str, link: bool = False,
name: str = theme_name, size: str = "standard", tweaks=[], zip = False) -> None: name: str = theme_name, size: str = "standard", tweaks=[], zip = False, recreate_assets = True) -> None:
try: try:
os.makedirs(dest) # Create our destination directory os.makedirs(dest) # Create our destination directory
@@ -21,6 +22,8 @@ def create_theme(types: List[str], accents: List[str], dest: str, link: bool = F
for accent in accents: for accent in accents:
# Recolor colloid wrt our selection like mocha. latte # Recolor colloid wrt our selection like mocha. latte
recolor(ctp_colors[type], accent) recolor(ctp_colors[type], accent)
if recreate_assets:
recreate_xfwm4_assets(type)
theme_style: str = "light" if type == "latte" else "dark" 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]}" install_cmd: str = f"./install.sh -c {theme_style} -s {size} -n {name} -d {dest} -t {def_color_map[accent]}"
if tweaks: if tweaks:

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,8 +1,7 @@
from catppuccin import Flavour from catppuccin import Flavour
from .utils import replacetext, replaceAllText from .utils import replacetext, replaceAllText
from .var import (def_accent_dark, def_accent_light, def_color_map, src_dir, from .var import (def_accent_dark, def_accent_light, def_color_map, src_dir, work_dir)
theme_name, work_dir)
def recolor_accent(flavor, accent: str = "blue"): def recolor_accent(flavor, accent: str = "blue"):
@@ -71,10 +70,9 @@ def recolor(flavor, accent: str):
Recolor the theme. currently hard code it frappe Recolor the theme. currently hard code it frappe
""" """
print("Recoloring to suit catppuccin theme") print("Recoloring to suit catppuccin theme")
replacetext(f"{work_dir}/install.sh", "Colloid", theme_name)
print("Recoloring accents") print("Recoloring accents")
recolor_accent(flavor, accent) recolor_accent(flavor, accent)
print("Recoloring firefox")
recolor_firefox(flavor, accent) recolor_firefox(flavor, accent)
print("MOD: Gtkrc.sh") print("MOD: Gtkrc.sh")

View File

@@ -25,7 +25,7 @@ def replacetext(filepath: str, search_text: str, replace_text: str) -> None:
f.seek(0) f.seek(0)
f.write(file) f.write(file)
f.truncate() f.truncate()
except Exception as e: except Exception:
print(f"Failed to recolor {filepath}") print(f"Failed to recolor {filepath}")