chore: use correct theme dir for gtk if none is provided
Signed-off-by: Pranav <npv12@iitbbs.ac.in>
This commit is contained in:
2
.github/workflows/release.yml
vendored
2
.github/workflows/release.yml
vendored
@@ -23,7 +23,7 @@ jobs:
|
||||
- name: Install colloid specific deps
|
||||
run: sudo apt-get install sassc
|
||||
- name: Generate themes
|
||||
run: python ./install.py all -a all --zip
|
||||
run: python ./install.py all -a all --zip -d $PWD/release
|
||||
- name: Add zips to release
|
||||
uses: softprops/action-gh-release@v1
|
||||
with:
|
||||
|
13
install.py
13
install.py
@@ -6,10 +6,11 @@ Usage:
|
||||
python install.py [options]
|
||||
"""
|
||||
import argparse
|
||||
import os
|
||||
|
||||
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
|
||||
|
||||
parser = argparse.ArgumentParser(description="Catppuccin theme")
|
||||
parser.add_argument("flavor",
|
||||
@@ -29,7 +30,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")
|
||||
|
||||
@@ -87,5 +87,12 @@ if "all" in args.accent:
|
||||
else:
|
||||
accents = args.accent
|
||||
|
||||
filename = create_theme(flavors, accents, args.dest,
|
||||
if args.dest:
|
||||
dest = args.dest
|
||||
elif os.geteuid() == 0: # Sudo
|
||||
dest = "/usr/share/themes"
|
||||
else:
|
||||
dest = os.path.expanduser('~') + "/.themes"
|
||||
|
||||
filename = create_theme(flavors, accents, dest,
|
||||
args.link, args.name, args.size, args.tweaks, args.zip)
|
||||
|
@@ -6,10 +6,10 @@ 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
|
||||
from scripts.var import def_color_map, theme_name, work_dir
|
||||
|
||||
|
||||
def create_theme(types: List[str], accents: List[str], dest: str = tmp_dir, 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:
|
||||
|
||||
try:
|
||||
|
Reference in New Issue
Block a user