forked from catppuccin/gtk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.py
109 lines (92 loc) · 3.84 KB
/
install.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
"""
Main script to clone, recolor and install the theme.
Run this from the root of the repo.
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, work_dir
parser = argparse.ArgumentParser(description="Catppuccin theme")
parser.add_argument("flavor",
metavar="theme flavor",
type=str,
nargs="+",
choices=["mocha", "frappe", "macchiato", "latte", "all"],
help="Flavor of the theme to apply. Can be frappe, mocha, macchiato, latte")
parser.add_argument("--name", "-n",
metavar="theme name",
type=str,
default=theme_name,
dest="name",
help="Name of the theme to apply. Defaults to Catppuccin")
parser.add_argument("--dest", "-d",
metavar="destination",
type=str,
dest="dest",
help="Destination of the files. defaults to releases folder inside the root")
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", "float"],
help="Some specifc tweaks. like black, rimless, normal buttons")
parser.add_argument("-l", "--link",
help="Link advaita themes to our catppuccin theme",
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")
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:
flavors = ctp_colors.keys()
else:
flavors = args.flavor
if "all" in args.accent:
accents = get_all_accent().keys()
else:
accents = args.accent
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)