Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fe11342f37 | ||
|
|
6f000fc68e | ||
|
|
0f740c7627 | ||
|
|
6c2dc65865 | ||
|
|
f69f8195ef | ||
|
|
938685b73b | ||
|
|
20b9536605 | ||
|
|
fd805dbeea | ||
|
|
50b015a961 | ||
|
|
10e22baa48 | ||
|
|
a651c4d5a1 | ||
|
|
39b5831ded | ||
|
|
2f810a5797 | ||
|
|
20dcc6d958 | ||
|
|
923c07fe00 | ||
|
|
bac95e19ba | ||
|
|
117df083f0 | ||
|
|
94894f4bc2 | ||
|
|
9bf9fc5a59 | ||
|
|
a71fcfceec | ||
|
|
15f9b99ef4 | ||
|
|
a25d492117 | ||
|
|
6486d61532 | ||
|
|
7561592086 | ||
|
|
926424ec8f | ||
|
|
3f7965a900 | ||
|
|
bc05f7cbfe | ||
|
|
e9c55da91c | ||
|
|
1f09381660 | ||
|
|
49171606dc | ||
|
|
07c0f4aa7a | ||
|
|
4edce1099c | ||
|
|
7538163d37 | ||
|
|
967cae772c | ||
|
|
7ac2cd6b05 | ||
|
|
559faed606 | ||
|
|
d172cd3aa3 | ||
|
|
ef460f796f | ||
|
|
57419ecc86 | ||
|
|
e750f79a20 | ||
|
|
8e2281b3d1 | ||
|
|
6cf0b9da6b | ||
|
|
ace860be57 | ||
|
|
b9f3d52000 | ||
|
|
18a308ba41 | ||
|
|
2ef8de7aa6 | ||
|
|
2a4e21ec5e | ||
|
|
82424c0ba7 | ||
|
|
8ebb9b1fb3 | ||
|
|
85d421879e | ||
|
|
1b3b2b4cfa | ||
|
|
21b358c999 | ||
|
|
64ebafe93f | ||
|
|
72a05a46f0 | ||
|
|
d269edf9af | ||
|
|
3f82c6cfb7 | ||
|
|
d0267bc067 | ||
|
|
b63b2877cc | ||
|
|
1674b62989 | ||
|
|
4794d23095 | ||
|
|
654adcba00 | ||
|
|
809c7b9bac | ||
|
|
e96fbba972 | ||
|
|
8ae5599105 | ||
|
|
c7ab1fe321 | ||
|
|
e3e3910bc6 | ||
|
|
224c3fa38c | ||
|
|
236b905ac8 | ||
|
|
482c350d5a | ||
|
|
8889f151b0 | ||
|
|
7523e1e0ce | ||
|
|
d835a32978 | ||
|
|
9188989210 | ||
|
|
f75b986e9a | ||
|
|
f0165c865d | ||
|
|
2a9bad109d | ||
|
|
c4cf73e4cf | ||
|
|
7b40c005d8 | ||
|
|
1ae1f803db | ||
|
|
75a0cb7c29 | ||
|
|
60b9954c5b | ||
|
|
177bb20528 | ||
|
|
6e823240b3 | ||
|
|
3f460e5b46 | ||
|
|
73184229f5 | ||
|
|
dfff1a7817 | ||
|
|
686fe61569 | ||
|
|
57f10cc353 | ||
|
|
a21570fdab |
@@ -0,0 +1,28 @@
|
||||
**Describe the bug** A clear and concise description of what the bug is.
|
||||
|
||||
**Theme Version** Example: v1.9.0 or latest commit
|
||||
|
||||
**Operating System** Example: Ubuntu 22.04, Fedora 39
|
||||
|
||||
**Desktop Environment** Example: GNOME 45, KDE Plasma 6.0, XFCE 4.18
|
||||
|
||||
**Theme Variant** Example: Colloid-Dark, Colloid-Light, etc.
|
||||
|
||||
**Steps to reproduce** Steps to reproduce the behavior:
|
||||
|
||||
1. Go to '...'
|
||||
2. Click on '...'
|
||||
3. Scroll down to '...'
|
||||
4. See error
|
||||
|
||||
**Expected behavior** A clear and concise description of what you expected to
|
||||
happen.
|
||||
|
||||
**Screenshots** If applicable, add screenshots to help explain your problem.
|
||||
|
||||
**Logs** If applicable, add terminal output or system logs.
|
||||
|
||||
**Checklist**
|
||||
|
||||
- [ ] I checked if the issue already exists.
|
||||
- [ ] I provided enough information.
|
||||
@@ -11,3 +11,12 @@ src/main/gnome-shell/gnome-shell-Dark.css
|
||||
src/main/cinnamon/cinnamon.css
|
||||
src/main/cinnamon/cinnamon-Light.css
|
||||
src/main/cinnamon/cinnamon-Dark.css
|
||||
release/Colloid-Catppuccin.tar.xz
|
||||
release/Colloid-Dracula.tar.xz
|
||||
release/Colloid-Everforest.tar.xz
|
||||
release/Colloid-Gruvbox.tar.xz
|
||||
release/Colloid-Nord.tar.xz
|
||||
release/Colloid.tar.xz
|
||||
src/main/libadwaita/libadwaita-Dark.css
|
||||
src/main/libadwaita/libadwaita-Light.css
|
||||
src/main/libadwaita/libadwaita.css
|
||||
|
||||
@@ -71,9 +71,23 @@ Default ColorSchemes themes will follow the system style now ! (switch [light/da
|
||||
|
||||
https://github.com/vinceliuice/Colloid-gtk-theme/assets/7604295/d5c24086-08bc-45a4-b4d9-124c02249216
|
||||
|
||||
### Fix for Flatpak
|
||||
|
||||
```sh
|
||||
sudo flatpak override --filesystem=xdg-config/gtk-3.0 && sudo flatpak override --filesystem=xdg-config/gtk-4.0
|
||||
```
|
||||
|
||||
If you use flatpak apps, you can run this to fix theme issue
|
||||
|
||||
### ColorSchemes
|
||||
|
||||

|
||||
|
||||
### Tweaks
|
||||
|
||||

|
||||
|
||||
### Flatpak Installation
|
||||
### Flatpak Installation (gtk-3.0)
|
||||
|
||||
Automatically install your host GTK+ theme as a Flatpak. Use this:
|
||||
|
||||
|
||||
@@ -177,40 +177,40 @@ make_assets() {
|
||||
if [[ "$scheme" == '-Everforest' ]]; then
|
||||
case "$theme" in
|
||||
'')
|
||||
theme_color_dark='#458588'
|
||||
theme_color_light='#83a598'
|
||||
theme_color_dark='#3a94c5'
|
||||
theme_color_light='#7fbbb3'
|
||||
;;
|
||||
-Purple)
|
||||
theme_color_dark='#ab62b1'
|
||||
theme_color_light='#d386cd'
|
||||
theme_color_dark='#df69ba'
|
||||
theme_color_light='#D699B6'
|
||||
;;
|
||||
-Pink)
|
||||
theme_color_dark='#b16286'
|
||||
theme_color_light='#d3869b'
|
||||
;;
|
||||
-Red)
|
||||
theme_color_dark='#cc241d'
|
||||
theme_color_light='#fb4934'
|
||||
theme_color_dark='#f85552'
|
||||
theme_color_light='#E67E80'
|
||||
;;
|
||||
-Orange)
|
||||
theme_color_dark='#d65d0e'
|
||||
theme_color_light='#fe8019'
|
||||
theme_color_dark='#f57d26'
|
||||
theme_color_light='#E69875'
|
||||
;;
|
||||
-Yellow)
|
||||
theme_color_dark='#d79921'
|
||||
theme_color_light='#fabd2f'
|
||||
theme_color_dark='#dfa000'
|
||||
theme_color_light='#DBBC7F'
|
||||
;;
|
||||
-Green)
|
||||
theme_color_dark='#98971a'
|
||||
theme_color_light='#b8bb26'
|
||||
theme_color_dark='#8da101'
|
||||
theme_color_light='#A7C080'
|
||||
;;
|
||||
-Teal)
|
||||
theme_color_dark='#689d6a'
|
||||
theme_color_light='#8ec07c'
|
||||
theme_color_dark='#35a77c'
|
||||
theme_color_light='#83C092'
|
||||
;;
|
||||
-Grey)
|
||||
theme_color_dark='#3c3836'
|
||||
theme_color_light='#a89984'
|
||||
theme_color_dark='#414b50'
|
||||
theme_color_light='#e6e2cc'
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
@@ -400,7 +400,109 @@ make_assets() {
|
||||
cp -r "${SRC_DIR}/assets/metacity-1/assets${window}" "${THEME_DIR}/metacity-1/assets"
|
||||
cp -r "${SRC_DIR}/assets/metacity-1/thumbnail${ELSE_DARK:-}.png" "${THEME_DIR}/metacity-1/thumbnail.png"
|
||||
|
||||
cp -r "${SRC_DIR}/assets/xfwm4/assets${ELSE_LIGHT:-}${scheme}${window}/"*.png "${THEME_DIR}/xfwm4"
|
||||
cp -r "${SRC_DIR}/assets/xfwm4/assets${ELSE_LIGHT:-}${scheme}${window}-hdpi/"*.png "${THEME_DIR}-hdpi/xfwm4"
|
||||
cp -r "${SRC_DIR}/assets/xfwm4/assets${ELSE_LIGHT:-}${scheme}${window}-xhdpi/"*.png "${THEME_DIR}-xhdpi/xfwm4"
|
||||
cp -r "${SRC_DIR}/assets/xfwm4/svg/assets${ELSE_LIGHT:-}${window}/"*.svg "${THEME_DIR}/xfwm4"
|
||||
cp -r "${SRC_DIR}/assets/xfwm4/svg/assets${ELSE_LIGHT:-}${window}-hdpi/"*.svg "${THEME_DIR}-hdpi/xfwm4"
|
||||
cp -r "${SRC_DIR}/assets/xfwm4/svg/assets${ELSE_LIGHT:-}${window}-xhdpi/"*.svg "${THEME_DIR}-xhdpi/xfwm4"
|
||||
cp -r "${SRC_DIR}/assets/xfwm4/xpm/assets/"*.xpm "${THEME_DIR}/xfwm4"
|
||||
cp -r "${SRC_DIR}/assets/xfwm4/xpm/assets-hdpi/"*.xpm "${THEME_DIR}-hdpi/xfwm4"
|
||||
cp -r "${SRC_DIR}/assets/xfwm4/xpm/assets-xhdpi/"*.xpm "${THEME_DIR}-xhdpi/xfwm4"
|
||||
|
||||
if [[ "$normal" == "true" ]] ; then
|
||||
mv -f "${THEME_DIR}/xfwm4/button-active-Normal.xpm" "${THEME_DIR}/xfwm4/button-active.xpm"
|
||||
mv -f "${THEME_DIR}-hdpi/xfwm4/button-active-Normal.xpm" "${THEME_DIR}-hdpi/xfwm4/button-active.xpm"
|
||||
mv -f "${THEME_DIR}-xhdpi/xfwm4/button-active-Normal.xpm" "${THEME_DIR}-xhdpi/xfwm4/button-active.xpm"
|
||||
mv -f "${THEME_DIR}/xfwm4/button-inactive-Normal.xpm" "${THEME_DIR}/xfwm4/button-inactive.xpm"
|
||||
mv -f "${THEME_DIR}-hdpi/xfwm4/button-inactive-Normal.xpm" "${THEME_DIR}-hdpi/xfwm4/button-inactive.xpm"
|
||||
mv -f "${THEME_DIR}-xhdpi/xfwm4/button-inactive-Normal.xpm" "${THEME_DIR}-xhdpi/xfwm4/button-inactive.xpm"
|
||||
fi
|
||||
|
||||
case "$scheme" in
|
||||
'')
|
||||
button_close="#fd5f51"
|
||||
button_max="#38c76a"
|
||||
button_min="#fdbe04"
|
||||
;;
|
||||
-Nord)
|
||||
button_close="#bf616a"
|
||||
button_max="#a3be8c"
|
||||
button_min="#ebcb8b"
|
||||
;;
|
||||
-Gruvbox)
|
||||
button_close="#cc241d"
|
||||
button_max="#98971a"
|
||||
button_min="#d79921"
|
||||
;;
|
||||
-Dracula)
|
||||
if [[ "$color" == '-Light' ]]; then
|
||||
button_close="#ed5d5d"
|
||||
button_max="#43db68"
|
||||
button_min="#e3d93b"
|
||||
else
|
||||
button_close="#f44d4d"
|
||||
button_max="#4be772"
|
||||
button_min="#e8f467"
|
||||
fi
|
||||
;;
|
||||
-Catppuccin)
|
||||
if [[ "$color" == '-Light' ]]; then
|
||||
button_close="#e64553"
|
||||
button_max="#40a02b"
|
||||
button_min="#df8e1d"
|
||||
else
|
||||
button_close="#ea999c"
|
||||
button_max="#a6d189"
|
||||
button_min="#e5c890"
|
||||
fi
|
||||
;;
|
||||
-Everforest)
|
||||
if [[ "$color" == '-Light' ]]; then
|
||||
button_close="#e67e80"
|
||||
button_max="#93ac6c"
|
||||
button_min="#d6b77a"
|
||||
else
|
||||
button_close="#ff9c9e"
|
||||
button_max="#b6cf8f"
|
||||
button_min="#eacb8e"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
sed -i "s/#fd5f51/${button_close}/g" "${THEME_DIR}/xfwm4/close-active.svg"
|
||||
sed -i "s/#fd5f51/${button_close}/g" "${THEME_DIR}/xfwm4/close-prelight.svg"
|
||||
sed -i "s/#fd5f51/${button_close}/g" "${THEME_DIR}/xfwm4/close-pressed.svg"
|
||||
sed -i "s/#38c76a/${button_max}/g" "${THEME_DIR}/xfwm4/maximize-active.svg"
|
||||
sed -i "s/#38c76a/${button_max}/g" "${THEME_DIR}/xfwm4/maximize-prelight.svg"
|
||||
sed -i "s/#38c76a/${button_max}/g" "${THEME_DIR}/xfwm4/maximize-pressed.svg"
|
||||
sed -i "s/#38c76a/${button_max}/g" "${THEME_DIR}/xfwm4/maximize-toggled-active.svg"
|
||||
sed -i "s/#38c76a/${button_max}/g" "${THEME_DIR}/xfwm4/maximize-toggled-prelight.svg"
|
||||
sed -i "s/#38c76a/${button_max}/g" "${THEME_DIR}/xfwm4/maximize-toggled-pressed.svg"
|
||||
sed -i "s/#fdbe04/${button_min}/g" "${THEME_DIR}/xfwm4/hide-active.svg"
|
||||
sed -i "s/#fdbe04/${button_min}/g" "${THEME_DIR}/xfwm4/hide-prelight.svg"
|
||||
sed -i "s/#fdbe04/${button_min}/g" "${THEME_DIR}/xfwm4/hide-pressed.svg"
|
||||
|
||||
sed -i "s/#fd5f51/${button_close}/g" "${THEME_DIR}-hdpi/xfwm4/close-active.svg"
|
||||
sed -i "s/#fd5f51/${button_close}/g" "${THEME_DIR}-hdpi/xfwm4/close-prelight.svg"
|
||||
sed -i "s/#fd5f51/${button_close}/g" "${THEME_DIR}-hdpi/xfwm4/close-pressed.svg"
|
||||
sed -i "s/#38c76a/${button_max}/g" "${THEME_DIR}-hdpi/xfwm4/maximize-active.svg"
|
||||
sed -i "s/#38c76a/${button_max}/g" "${THEME_DIR}-hdpi/xfwm4/maximize-prelight.svg"
|
||||
sed -i "s/#38c76a/${button_max}/g" "${THEME_DIR}-hdpi/xfwm4/maximize-pressed.svg"
|
||||
sed -i "s/#38c76a/${button_max}/g" "${THEME_DIR}-hdpi/xfwm4/maximize-toggled-active.svg"
|
||||
sed -i "s/#38c76a/${button_max}/g" "${THEME_DIR}-hdpi/xfwm4/maximize-toggled-prelight.svg"
|
||||
sed -i "s/#38c76a/${button_max}/g" "${THEME_DIR}-hdpi/xfwm4/maximize-toggled-pressed.svg"
|
||||
sed -i "s/#fdbe04/${button_min}/g" "${THEME_DIR}-hdpi/xfwm4/hide-active.svg"
|
||||
sed -i "s/#fdbe04/${button_min}/g" "${THEME_DIR}-hdpi/xfwm4/hide-prelight.svg"
|
||||
sed -i "s/#fdbe04/${button_min}/g" "${THEME_DIR}-hdpi/xfwm4/hide-pressed.svg"
|
||||
|
||||
sed -i "s/#fd5f51/${button_close}/g" "${THEME_DIR}-xhdpi/xfwm4/close-active.svg"
|
||||
sed -i "s/#fd5f51/${button_close}/g" "${THEME_DIR}-xhdpi/xfwm4/close-prelight.svg"
|
||||
sed -i "s/#fd5f51/${button_close}/g" "${THEME_DIR}-xhdpi/xfwm4/close-pressed.svg"
|
||||
sed -i "s/#38c76a/${button_max}/g" "${THEME_DIR}-xhdpi/xfwm4/maximize-active.svg"
|
||||
sed -i "s/#38c76a/${button_max}/g" "${THEME_DIR}-xhdpi/xfwm4/maximize-prelight.svg"
|
||||
sed -i "s/#38c76a/${button_max}/g" "${THEME_DIR}-xhdpi/xfwm4/maximize-pressed.svg"
|
||||
sed -i "s/#38c76a/${button_max}/g" "${THEME_DIR}-xhdpi/xfwm4/maximize-toggled-active.svg"
|
||||
sed -i "s/#38c76a/${button_max}/g" "${THEME_DIR}-xhdpi/xfwm4/maximize-toggled-prelight.svg"
|
||||
sed -i "s/#38c76a/${button_max}/g" "${THEME_DIR}-xhdpi/xfwm4/maximize-toggled-pressed.svg"
|
||||
sed -i "s/#fdbe04/${button_min}/g" "${THEME_DIR}-xhdpi/xfwm4/hide-active.svg"
|
||||
sed -i "s/#fdbe04/${button_min}/g" "${THEME_DIR}-xhdpi/xfwm4/hide-prelight.svg"
|
||||
sed -i "s/#fdbe04/${button_min}/g" "${THEME_DIR}-xhdpi/xfwm4/hide-pressed.svg"
|
||||
}
|
||||
|
||||
@@ -10,13 +10,15 @@ if [ ! "$(which sassc 2> /dev/null)" ]; then
|
||||
if has_command zypper; then
|
||||
sudo zypper in sassc
|
||||
elif has_command apt; then
|
||||
sudo apt install sassc
|
||||
sudo apt install -y sassc
|
||||
elif has_command dnf; then
|
||||
sudo dnf install -y sassc
|
||||
elif has_command yum; then
|
||||
sudo yum install sassc
|
||||
sudo yum install -y sassc
|
||||
elif has_command pacman; then
|
||||
sudo pacman -S --noconfirm sassc
|
||||
elif has_command xbps-install; then
|
||||
sudo xbps-install -y sassc
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -35,6 +37,8 @@ for color in "${_COLOR_VARIANTS[@]}"; do
|
||||
echo "==> Generating the 3.0 gtk${color}.css..."
|
||||
sassc $SASSC_OPT src/main/gtk-4.0/gtk${color}.{scss,css}
|
||||
echo "==> Generating the 4.0 gtk${color}.css..."
|
||||
sassc $SASSC_OPT src/main/libadwaita/libadwaita${color}.{scss,css}
|
||||
echo "==> Generating the libadwaita libadwaita${color}.css..."
|
||||
sassc $SASSC_OPT src/main/gnome-shell/gnome-shell${color}.{scss,css}
|
||||
echo "==> Generating the gnome-shell${color}.css..."
|
||||
sassc $SASSC_OPT src/main/cinnamon/cinnamon${color}.{scss,css}
|
||||
|
||||
|
After Width: | Height: | Size: 963 KiB |
@@ -0,0 +1,27 @@
|
||||
{
|
||||
"nodes": {
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1785454630,
|
||||
"narHash": "sha256-LQy14TZp77TwbQf40gg1V3jo8FwJG0jGDkAH+zRHqg8=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "1559d3daa3ecc813a650b79375ea61b6741b8746",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "NixOS",
|
||||
"ref": "nixos-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"nixpkgs": "nixpkgs"
|
||||
}
|
||||
}
|
||||
},
|
||||
"root": "root",
|
||||
"version": 7
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
{
|
||||
description = "Modern and clean Gtk theme";
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
};
|
||||
|
||||
outputs = { self, nixpkgs }:
|
||||
let
|
||||
system = "x86_64-linux";
|
||||
|
||||
pkgs = import nixpkgs {
|
||||
inherit system;
|
||||
};
|
||||
|
||||
in {
|
||||
packages.${system}.default =
|
||||
pkgs.callPackage ./nix/default.nix {};
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,382 @@
|
||||
#!/usr/bin/python3
|
||||
import os
|
||||
import sys
|
||||
import shutil
|
||||
import pathlib
|
||||
import logging
|
||||
|
||||
# 定义统一的应用 ID (需与 .desktop 文件名对应,如 org.gnome.GTK4ThemeSwitcher.desktop)
|
||||
APP_ID = "org.gnome.GTK4ThemeSwitcher"
|
||||
|
||||
# Ensure PyGObject and GTK4 are available
|
||||
try:
|
||||
import gi
|
||||
gi.require_version('Gtk', '4.0')
|
||||
from gi.repository import Gtk, Gio, Pango, GLib
|
||||
except ImportError as e:
|
||||
print("错误: 缺少必要的依赖。请确保已安装 PyGObject 和 GTK4。")
|
||||
print("在 Ubuntu/Debian 上运行: sudo apt install python3-gi libgtk-4-dev")
|
||||
print("在 Fedora 上运行: sudo dnf install python3-gobject gtk4")
|
||||
print("在 Arch Linux 上运行: sudo pacman -S python-gobject gtk4")
|
||||
sys.exit(1)
|
||||
|
||||
# Set up logging
|
||||
logging.basicConfig(level=logging.INFO, format="%(asctime)s [%(levelname)s] %(message)s")
|
||||
|
||||
class ThemeManager:
|
||||
"""负责搜索、解析以及处理 GTK4 主题文件软链接的核心类"""
|
||||
|
||||
SEARCH_PATHS = [
|
||||
os.path.expanduser("~/.themes"),
|
||||
os.path.expanduser("~/.local/share/themes"),
|
||||
"/usr/share/themes" # 包含系统全局主题供参考选择
|
||||
]
|
||||
TARGET_CONFIG_DIR = os.path.expanduser("~/.config/gtk-4.0")
|
||||
|
||||
@classmethod
|
||||
def get_available_themes(cls):
|
||||
"""扫描所有指定目录,搜寻存在 gtk-4.0 子目录的主题文件夹"""
|
||||
themes = []
|
||||
|
||||
for base_path in cls.SEARCH_PATHS:
|
||||
if not os.path.exists(base_path) or not os.path.isdir(base_path):
|
||||
continue
|
||||
|
||||
try:
|
||||
for entry in os.listdir(base_path):
|
||||
full_path = os.path.join(base_path, entry)
|
||||
if os.path.isdir(full_path):
|
||||
gtk4_path = os.path.join(full_path, "gtk-4.0")
|
||||
has_gtk4 = os.path.exists(gtk4_path) and os.path.isdir(gtk4_path)
|
||||
|
||||
themes.append({
|
||||
"name": entry,
|
||||
"path": full_path,
|
||||
"gtk4_path": gtk4_path if has_gtk4 else None,
|
||||
"is_local": base_path.startswith(os.path.expanduser("~")),
|
||||
"has_gtk4": has_gtk4
|
||||
})
|
||||
except Exception as err:
|
||||
logging.error(f"读取目录 {base_path} 失败: {err}")
|
||||
|
||||
# 去重并排序 (优先保留用户目录下的同名主题)
|
||||
unique_themes = {}
|
||||
for theme in themes:
|
||||
name = theme["name"]
|
||||
if name not in unique_themes or theme["is_local"]:
|
||||
unique_themes[name] = theme
|
||||
|
||||
sorted_themes = sorted(list(unique_themes.values()), key=lambda x: (not x["has_gtk4"], x["name"].lower()))
|
||||
return sorted_themes
|
||||
|
||||
@classmethod
|
||||
def apply_gtk4_theme(cls, theme_info):
|
||||
"""将选定主题的 gtk-4.0 内容软链接到 ~/.config/gtk-4.0/"""
|
||||
src_gtk4_dir = theme_info.get("gtk4_path")
|
||||
if not src_gtk4_dir or not os.path.exists(src_gtk4_dir):
|
||||
return False, f"主题 '{theme_info['name']}' 不包含 gtk-4.0 文件夹!"
|
||||
|
||||
target_dir = cls.TARGET_CONFIG_DIR
|
||||
|
||||
try:
|
||||
# 确保目标配置目录存在
|
||||
os.makedirs(target_dir, exist_ok=True)
|
||||
|
||||
# 清理 ~/.config/gtk-4.0 目录下的旧链接和文件
|
||||
for item in os.listdir(target_dir):
|
||||
item_path = os.path.join(target_dir, item)
|
||||
if os.path.islink(item_path) or os.path.isfile(item_path):
|
||||
os.unlink(item_path)
|
||||
elif os.path.isdir(item_path):
|
||||
shutil.rmtree(item_path)
|
||||
|
||||
# 遍历源主题 gtk-4.0 中的所有内容并建立软链接
|
||||
linked_files = []
|
||||
for item in os.listdir(src_gtk4_dir):
|
||||
src_item = os.path.join(src_gtk4_dir, item)
|
||||
dst_item = os.path.join(target_dir, item)
|
||||
|
||||
os.symlink(src_item, dst_item)
|
||||
linked_files.append(item)
|
||||
|
||||
# 设置 GTK 3.0 主题 (通过 GSettings: org.gnome.desktop.interface gtk-theme)
|
||||
gtk3_msg = ""
|
||||
try:
|
||||
settings = Gio.Settings.new("org.gnome.desktop.interface")
|
||||
settings.set_string("gtk-theme", theme_info["name"])
|
||||
gtk3_msg = f"\n同时已将 GTK 3 主题设置为 '{theme_info['name']}'。"
|
||||
except Exception as gset_err:
|
||||
logging.error(f"设置 GTK 3 主题失败: {gset_err}")
|
||||
gtk3_msg = f"\n(注意: 设置 GTK 3 主题失败: {gset_err})"
|
||||
|
||||
logging.info(f"成功为主题 {theme_info['name']} 创建软链接: {linked_files}")
|
||||
return True, f"已成功将主题 '{theme_info['name']}' 应用到 GTK 4!\n共链接了 {len(linked_files)} 个项。{gtk3_msg}"
|
||||
|
||||
except Exception as e:
|
||||
logging.error(f"应用主题失败: {e}")
|
||||
return False, f"发生错误: {str(e)}"
|
||||
|
||||
@classmethod
|
||||
def get_active_theme_name(cls):
|
||||
"""通过分析 ~/.config/gtk-4.0 中的软链接目标,判断当前生效的主题"""
|
||||
target_dir = cls.TARGET_CONFIG_DIR
|
||||
if not os.path.exists(target_dir):
|
||||
return None
|
||||
|
||||
try:
|
||||
for item in os.listdir(target_dir):
|
||||
item_path = os.path.join(target_dir, item)
|
||||
if os.path.islink(item_path):
|
||||
real_path = os.path.realpath(item_path)
|
||||
for base_path in cls.SEARCH_PATHS:
|
||||
if real_path.startswith(base_path):
|
||||
rel_path = os.path.relpath(real_path, base_path)
|
||||
parts = rel_path.split(os.sep)
|
||||
if len(parts) >= 1:
|
||||
return parts[0]
|
||||
except Exception as e:
|
||||
logging.error(f"检测当前生效主题失败: {e}")
|
||||
return None
|
||||
|
||||
|
||||
class ThemeRow(Gtk.ListBoxRow):
|
||||
"""用于在列表中展示主题条目的自定义 Widget"""
|
||||
|
||||
def __init__(self, theme_data, is_active=False):
|
||||
super().__init__()
|
||||
self.theme_data = theme_data
|
||||
self.is_active = is_active
|
||||
|
||||
box = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=12)
|
||||
box.set_margin_top(10)
|
||||
box.set_margin_bottom(10)
|
||||
box.set_margin_start(16)
|
||||
box.set_margin_end(16)
|
||||
|
||||
# 图标展示
|
||||
icon_name = "preferences-desktop-theme-symbolic" if theme_data["has_gtk4"] else "dialog-warning-symbolic"
|
||||
icon = Gtk.Image.new_from_icon_name(icon_name)
|
||||
icon.set_pixel_size(24)
|
||||
box.append(icon)
|
||||
|
||||
# 文字信息
|
||||
vbox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, spacing=2)
|
||||
vbox.set_hexpand(True)
|
||||
|
||||
title_label = Gtk.Label(label=theme_data["name"])
|
||||
title_label.set_xalign(0)
|
||||
title_label.add_css_class("title-4")
|
||||
vbox.append(title_label)
|
||||
|
||||
sub_text = f"路径: {theme_data['path']}"
|
||||
if not theme_data["has_gtk4"]:
|
||||
sub_text += " (无 gtk-4.0 配置)"
|
||||
subtitle_label = Gtk.Label(label=sub_text)
|
||||
subtitle_label.set_xalign(0)
|
||||
subtitle_label.add_css_class("dim-label")
|
||||
subtitle_label.add_css_class("caption")
|
||||
vbox.append(subtitle_label)
|
||||
|
||||
box.append(vbox)
|
||||
|
||||
# 状态或标签
|
||||
if theme_data["has_gtk4"]:
|
||||
badge = Gtk.Label(label="GTK 4 支持")
|
||||
badge.add_css_class("accent")
|
||||
badge.add_css_class("caption")
|
||||
box.append(badge)
|
||||
else:
|
||||
badge = Gtk.Label(label="缺少 GTK4")
|
||||
badge.add_css_class("dim-label")
|
||||
badge.add_css_class("caption")
|
||||
box.append(badge)
|
||||
|
||||
# 当前生效勾选标志 (图标 + 文字)
|
||||
if is_active:
|
||||
active_box = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=4)
|
||||
check_icon = Gtk.Image.new_from_icon_name("emblem-ok-symbolic")
|
||||
check_icon.add_css_class("accent")
|
||||
active_label = Gtk.Label(label=" 已应用")
|
||||
active_label.add_css_class("accent")
|
||||
active_label.add_css_class("caption")
|
||||
|
||||
active_box.append(check_icon)
|
||||
active_box.append(active_label)
|
||||
box.append(active_box)
|
||||
|
||||
self.set_child(box)
|
||||
|
||||
|
||||
class MainWindow(Gtk.ApplicationWindow):
|
||||
"""主程序窗口组件"""
|
||||
|
||||
def __init__(self, app):
|
||||
super().__init__(application=app)
|
||||
self.set_title("GNOME GTK4 主题管理器")
|
||||
self.set_default_size(580, 620)
|
||||
|
||||
self.all_themes = []
|
||||
self.selected_theme = None
|
||||
self.active_theme_name = None
|
||||
|
||||
# 主垂直布局容器
|
||||
main_box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, spacing=0)
|
||||
self.set_child(main_box)
|
||||
|
||||
# --- 顶栏 HeaderBar ---
|
||||
header = Gtk.HeaderBar()
|
||||
self.set_titlebar(header)
|
||||
|
||||
# 刷新按钮
|
||||
refresh_btn = Gtk.Button.new_from_icon_name("view-refresh-symbolic")
|
||||
refresh_btn.set_tooltip_text("重新检索主题目录")
|
||||
refresh_btn.connect("clicked", lambda x: self.load_themes())
|
||||
header.pack_start(refresh_btn)
|
||||
|
||||
# --- 搜索与筛选工具栏 ---
|
||||
toolbar = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=8)
|
||||
toolbar.set_margin_top(12)
|
||||
toolbar.set_margin_bottom(12)
|
||||
toolbar.set_margin_start(16)
|
||||
toolbar.set_margin_end(16)
|
||||
|
||||
self.search_entry = Gtk.SearchEntry()
|
||||
self.search_entry.set_placeholder_text("搜索本地主题...")
|
||||
self.search_entry.set_hexpand(True)
|
||||
self.search_entry.connect("search-changed", self.on_search_changed)
|
||||
toolbar.append(self.search_entry)
|
||||
|
||||
main_box.append(toolbar)
|
||||
|
||||
# --- 主题列表区域 ---
|
||||
scrolled = Gtk.ScrolledWindow()
|
||||
scrolled.set_vexpand(True)
|
||||
|
||||
self.list_box = Gtk.ListBox()
|
||||
self.list_box.set_selection_mode(Gtk.SelectionMode.SINGLE)
|
||||
self.list_box.add_css_class("rich-list")
|
||||
self.list_box.connect("row-selected", self.on_row_selected)
|
||||
scrolled.set_child(self.list_box)
|
||||
|
||||
main_box.append(scrolled)
|
||||
|
||||
# --- 底部动作栏 ---
|
||||
bottom_bar = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=12)
|
||||
bottom_bar.set_margin_top(12)
|
||||
bottom_bar.set_margin_bottom(12)
|
||||
bottom_bar.set_margin_start(16)
|
||||
bottom_bar.set_margin_end(16)
|
||||
|
||||
# 状态文字
|
||||
self.status_label = Gtk.Label(label="正在加载主题...")
|
||||
self.status_label.set_xalign(0)
|
||||
self.status_label.set_hexpand(True)
|
||||
self.status_label.set_ellipsize(3) # Pango.EllipsizeMode.END
|
||||
bottom_bar.append(self.status_label)
|
||||
|
||||
# 应用按钮
|
||||
self.apply_button = Gtk.Button(label="应用所选主题到 GTK 4")
|
||||
self.apply_button.add_css_class("suggested-action")
|
||||
self.apply_button.set_sensitive(False)
|
||||
self.apply_button.connect("clicked", self.on_apply_clicked)
|
||||
self.apply_button.connect("clicked", lambda x: self.load_themes())
|
||||
bottom_bar.append(self.apply_button)
|
||||
|
||||
main_box.append(bottom_bar)
|
||||
|
||||
# 初始加载主题数据
|
||||
self.load_themes()
|
||||
|
||||
def load_themes(self):
|
||||
"""从磁盘重新加载和渲染主题列表"""
|
||||
self.all_themes = ThemeManager.get_available_themes()
|
||||
self.active_theme_name = ThemeManager.get_active_theme_name()
|
||||
self.filter_and_render_themes()
|
||||
|
||||
count_gtk4 = sum(1 for t in self.all_themes if t["has_gtk4"])
|
||||
status_msg = f"已找到 {len(self.all_themes)} 个主题 (其中 {count_gtk4} 个包含 GTK 4 配置)"
|
||||
if self.active_theme_name:
|
||||
status_msg += f" | 当前生效: {self.active_theme_name}"
|
||||
self.status_label.set_text(status_msg)
|
||||
|
||||
def filter_and_render_themes(self):
|
||||
"""根据搜索关键词过滤并填充 ListBox"""
|
||||
# 清除原有 ListBox 节点
|
||||
while True:
|
||||
row = self.list_box.get_row_at_index(0)
|
||||
if row is None:
|
||||
break
|
||||
self.list_box.remove(row)
|
||||
|
||||
query = self.search_entry.get_text().strip().lower()
|
||||
|
||||
for theme in self.all_themes:
|
||||
if query and query not in theme["name"].lower():
|
||||
continue
|
||||
is_active = (theme["name"] == self.active_theme_name)
|
||||
row = ThemeRow(theme, is_active=is_active)
|
||||
self.list_box.append(row)
|
||||
|
||||
self.apply_button.set_sensitive(False)
|
||||
self.selected_theme = None
|
||||
|
||||
def on_search_changed(self, entry):
|
||||
"""搜索框输入变更事件处理"""
|
||||
self.filter_and_render_themes()
|
||||
|
||||
def on_row_selected(self, listbox, row):
|
||||
"""用户选中列表中某行主题的处理"""
|
||||
if row is None:
|
||||
self.selected_theme = None
|
||||
self.apply_button.set_sensitive(False)
|
||||
return
|
||||
|
||||
self.selected_theme = row.theme_data
|
||||
|
||||
# 仅当主题包含 gtk-4.0 文件夹时才启用应用按钮
|
||||
if self.selected_theme["has_gtk4"]:
|
||||
self.apply_button.set_sensitive(True)
|
||||
self.status_label.set_text(f"已选中: {self.selected_theme['name']}")
|
||||
else:
|
||||
self.apply_button.set_sensitive(False)
|
||||
self.status_label.set_text(f"警告: {self.selected_theme['name']} 缺少 gtk-4.0 目录")
|
||||
|
||||
def on_apply_clicked(self, button):
|
||||
"""点击应用按钮的响应逻辑"""
|
||||
if not self.selected_theme:
|
||||
return
|
||||
|
||||
success, message = ThemeManager.apply_gtk4_theme(self.selected_theme)
|
||||
|
||||
if success:
|
||||
self.active_theme_name = self.selected_theme["name"]
|
||||
self.status_label.set_text(f"当前生效主题: {self.active_theme_name}")
|
||||
self.filter_and_render_themes()
|
||||
|
||||
|
||||
class Application(Gtk.Application):
|
||||
def __init__(self):
|
||||
super().__init__(
|
||||
application_id=APP_ID,
|
||||
flags=Gio.ApplicationFlags.FLAGS_NONE
|
||||
)
|
||||
|
||||
def do_activate(self):
|
||||
win = self.props.active_window
|
||||
if not win:
|
||||
win = MainWindow(self)
|
||||
win.present()
|
||||
|
||||
|
||||
def main():
|
||||
# 显式设置进程名 (prgname) 和应用名称
|
||||
# 解决 Python 脚本运行时默认进程名被识别为 python3 导致 Wayland / X11 WM_CLASS 不匹配图标的问题
|
||||
GLib.set_prgname(APP_ID)
|
||||
GLib.set_application_name("GNOME GTK4 主题管理器")
|
||||
|
||||
app = Application()
|
||||
return app.run(sys.argv)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
sys.exit(main())
|
||||
@@ -178,40 +178,40 @@ make_gtkrc() {
|
||||
if [[ "$scheme" == '-Everforest' ]]; then
|
||||
case "$theme" in
|
||||
'')
|
||||
theme_color_dark='#458588'
|
||||
theme_color_light='#83a598'
|
||||
theme_color_dark='#3a94c5'
|
||||
theme_color_light='#7fbbb3'
|
||||
;;
|
||||
-Purple)
|
||||
theme_color_dark='#ab62b1'
|
||||
theme_color_light='#d386cd'
|
||||
theme_color_dark='#df69ba'
|
||||
theme_color_light='#D699B6'
|
||||
;;
|
||||
-Pink)
|
||||
theme_color_dark='#b16286'
|
||||
theme_color_light='#d3869b'
|
||||
;;
|
||||
-Red)
|
||||
theme_color_dark='#cc241d'
|
||||
theme_color_light='#fb4934'
|
||||
theme_color_dark='#f85552'
|
||||
theme_color_light='#E67E80'
|
||||
;;
|
||||
-Orange)
|
||||
theme_color_dark='#d65d0e'
|
||||
theme_color_light='#fe8019'
|
||||
theme_color_dark='#f57d26'
|
||||
theme_color_light='#E69875'
|
||||
;;
|
||||
-Yellow)
|
||||
theme_color_dark='#d79921'
|
||||
theme_color_light='#fabd2f'
|
||||
theme_color_dark='#dfa000'
|
||||
theme_color_light='#DBBC7F'
|
||||
;;
|
||||
-Green)
|
||||
theme_color_dark='#98971a'
|
||||
theme_color_light='#b8bb26'
|
||||
theme_color_dark='#8da101'
|
||||
theme_color_light='#A7C080'
|
||||
;;
|
||||
-Teal)
|
||||
theme_color_dark='#689d6a'
|
||||
theme_color_light='#8ec07c'
|
||||
theme_color_dark='#35a77c'
|
||||
theme_color_light='#83C092'
|
||||
;;
|
||||
-Grey)
|
||||
theme_color_dark='#3c3836'
|
||||
theme_color_light='#a89984'
|
||||
theme_color_dark='#414b50'
|
||||
theme_color_light='#e6e2cc'
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
@@ -15,8 +15,14 @@ scheme=
|
||||
window=
|
||||
|
||||
# Destination directory
|
||||
if [ "$UID" -eq "$ROOT_UID" ]; then
|
||||
if [[ "$UID" -eq "$ROOT_UID" ]]; then
|
||||
DEST_DIR="/usr/share/themes"
|
||||
elif [[ -n "$XDG_DATA_HOME" ]]; then
|
||||
DEST_DIR="$XDG_DATA_HOME/themes"
|
||||
elif [[ -d "$HOME/.themes" ]]; then
|
||||
DEST_DIR="$HOME/.themes"
|
||||
elif [[ -d "$HOME/.local/share/themes" ]]; then
|
||||
DEST_DIR="$HOME/.local/share/themes"
|
||||
else
|
||||
DEST_DIR="$HOME/.themes"
|
||||
fi
|
||||
@@ -31,8 +37,14 @@ SIZE_VARIANTS=('' '-Compact')
|
||||
|
||||
if [[ "$(command -v gnome-shell)" ]]; then
|
||||
echo && gnome-shell --version
|
||||
|
||||
SHELL_VERSION="$(gnome-shell --version | cut -d ' ' -f 3 | cut -d . -f -1)"
|
||||
if [[ "${SHELL_VERSION:-}" -ge "46" ]]; then
|
||||
|
||||
if [[ "${SHELL_VERSION:-}" -ge "48" ]]; then
|
||||
GS_VERSION="48-0"
|
||||
elif [[ "${SHELL_VERSION:-}" -ge "47" ]]; then
|
||||
GS_VERSION="47-0"
|
||||
elif [[ "${SHELL_VERSION:-}" -ge "46" ]]; then
|
||||
GS_VERSION="46-0"
|
||||
elif [[ "${SHELL_VERSION:-}" -ge "44" ]]; then
|
||||
GS_VERSION="44-0"
|
||||
@@ -45,7 +57,7 @@ if [[ "$(command -v gnome-shell)" ]]; then
|
||||
fi
|
||||
else
|
||||
echo "'gnome-shell' not found, using styles for last gnome-shell version available."
|
||||
GS_VERSION="46-0"
|
||||
GS_VERSION="48-0"
|
||||
fi
|
||||
|
||||
usage() {
|
||||
@@ -70,7 +82,7 @@ OPTIONS:
|
||||
2. fixed Using fixed theme colors (that will break light/dark mode switch)
|
||||
|
||||
--tweaks Specify versions for tweaks
|
||||
1. [nord|dracula|gruvbox|everforest|catppuccin|all] (Nord/Dracula/Gruvbox/Everforet/Catppuccin/all) ColorSchemes version
|
||||
1. [nord|dracula|gruvbox|everforest|catppuccin|all] (Nord/Dracula/Gruvbox/Everforest/Catppuccin/all) ColorSchemes version
|
||||
2. black Blackness color version
|
||||
3. rimless Remove the 1px border about windows and menus
|
||||
4. normal Normal windows button style like gnome default theme (titlebuttons: max/min/close)
|
||||
@@ -97,7 +109,7 @@ install() {
|
||||
|
||||
local THEME_DIR="${1}/${2}${3}${4}${5}${6}"
|
||||
|
||||
[[ -d "${THEME_DIR}" ]] && rm -rf "${THEME_DIR}"
|
||||
[[ -d "${THEME_DIR}" ]] && rm -rf "${THEME_DIR}"{'','-hdpi','-xhdpi'}
|
||||
|
||||
echo "Installing '${THEME_DIR}'..."
|
||||
|
||||
@@ -114,7 +126,7 @@ install() {
|
||||
echo "[X-GNOME-Metatheme]" >> "${THEME_DIR}/index.theme"
|
||||
echo "GtkTheme=${2}${3}${4}${5}${6}" >> "${THEME_DIR}/index.theme"
|
||||
echo "MetacityTheme=${2}${3}${4}${5}${6}" >> "${THEME_DIR}/index.theme"
|
||||
echo "IconTheme=Tela-circle${ELSE_DARK:-}" >> "${THEME_DIR}/index.theme"
|
||||
echo "IconTheme=Colloid${3}${6}${4}" >> "${THEME_DIR}/index.theme"
|
||||
echo "CursorTheme=${2}-cursors" >> "${THEME_DIR}/index.theme"
|
||||
echo "ButtonLayout=close,minimize,maximize:menu" >> "${THEME_DIR}/index.theme"
|
||||
|
||||
@@ -150,6 +162,10 @@ install() {
|
||||
cp -r "${SRC_DIR}/main/xfwm4/themerc" "${THEME_DIR}-xhdpi/xfwm4/themerc"
|
||||
sed -i "s/button_offset=6/button_offset=12/" "${THEME_DIR}-xhdpi/xfwm4/themerc"
|
||||
|
||||
mkdir -p "${THEME_DIR}/labwc"
|
||||
cp "${SRC_DIR}/main/labwc/themerc${color}${scheme}" "${THEME_DIR}/labwc/themerc"
|
||||
cp -r "${SRC_DIR}/assets/labwc/assets${color}/"*.svg "${THEME_DIR}/labwc/"
|
||||
|
||||
mkdir -p "${THEME_DIR}/plank"
|
||||
if [[ "$color" == '-Light' ]]; then
|
||||
cp -r "${SRC_DIR}/main/plank/theme-Light${scheme}/"* "${THEME_DIR}/plank"
|
||||
@@ -400,23 +416,23 @@ while [[ $# -gt 0 ]]; do
|
||||
esac
|
||||
done
|
||||
|
||||
if [[ "${#themes[@]}" -eq 0 ]] ; then
|
||||
if [[ "${#themes[@]}" -eq 0 ]]; then
|
||||
themes=("${THEME_VARIANTS[0]}")
|
||||
fi
|
||||
|
||||
if [[ "${#colors[@]}" -eq 0 ]] ; then
|
||||
if [[ "${#colors[@]}" -eq 0 ]]; then
|
||||
colors=("${COLOR_VARIANTS[@]}")
|
||||
fi
|
||||
|
||||
if [[ "${#lcolors[@]}" -eq 0 ]] ; then
|
||||
if [[ "${#lcolors[@]}" -eq 0 ]]; then
|
||||
lcolors=("${COLOR_VARIANTS[1]}")
|
||||
fi
|
||||
|
||||
if [[ "${#sizes[@]}" -eq 0 ]] ; then
|
||||
if [[ "${#sizes[@]}" -eq 0 ]]; then
|
||||
sizes=("${SIZE_VARIANTS[0]}")
|
||||
fi
|
||||
|
||||
if [[ "${#schemes[@]}" -eq 0 ]] ; then
|
||||
if [[ "${#schemes[@]}" -eq 0 ]]; then
|
||||
schemes=("${SCHEME_VARIANTS[0]}")
|
||||
fi
|
||||
|
||||
@@ -441,6 +457,8 @@ install_package() {
|
||||
sudo yum install sassc
|
||||
elif has_command pacman; then
|
||||
sudo pacman -S --noconfirm sassc
|
||||
elif has_command xbps-install; then
|
||||
sudo xbps-install -y sassc
|
||||
fi
|
||||
fi
|
||||
}
|
||||
@@ -502,8 +520,14 @@ gnome_shell_version() {
|
||||
|
||||
sed -i "/\widgets/s/40-0/${GS_VERSION}/" "${SRC_DIR}/sass/gnome-shell/_common-temp.scss"
|
||||
|
||||
if [[ "${GS_VERSION}" != '40-0' && "${GS_VERSION}" != '42-0' && "${GS_VERSION}" != '44-0' ]]; then
|
||||
sed -i "/\extensions/s/40-0/${GS_VERSION}/" "${SRC_DIR}/sass/gnome-shell/_common-temp.scss"
|
||||
if [[ "${GS_VERSION}" == '3-28' ]]; then
|
||||
sed -i "/\extensions/s/40-0/3-28/" "${SRC_DIR}/sass/gnome-shell/_common-temp.scss"
|
||||
elif [[ "${GS_VERSION}" -ge '46-0' ]]; then
|
||||
sed -i "/\extensions/s/40-0/46-0/" "${SRC_DIR}/sass/gnome-shell/_common-temp.scss"
|
||||
fi
|
||||
|
||||
if [[ "${SHELL_VERSION:-}" -ge "47" ]]; then
|
||||
sed -i "/\gnome_version/s/default/new/" "${SRC_DIR}/sass/_tweaks-temp.scss"
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -682,22 +706,50 @@ uninstall() {
|
||||
|
||||
local THEME_DIR="${1}/${2}${3}${4}${5}${6}"
|
||||
|
||||
if [[ "$uninstall" == 'true' ]]; then
|
||||
type='Uninstall'
|
||||
else
|
||||
type='Clean'
|
||||
fi
|
||||
|
||||
if [[ -d "${THEME_DIR}" ]]; then
|
||||
echo -e "Uninstall ${THEME_DIR}... "
|
||||
rm -rf "${THEME_DIR}"
|
||||
echo -e "${type} ${THEME_DIR}... "
|
||||
rm -rf "${THEME_DIR}"{'','-hdpi','-xhdpi'}
|
||||
fi
|
||||
}
|
||||
|
||||
uninstall_theme() {
|
||||
for theme in "${themes[@]}"; do
|
||||
for color in "${colors[@]}"; do
|
||||
for size in "${sizes[@]}"; do
|
||||
uninstall "${dest:-$DEST_DIR}" "${name:-$THEME_NAME}" "$theme" "$color" "$size" "$scheme"
|
||||
for theme in "${THEME_VARIANTS[@]}"; do
|
||||
for color in "${COLOR_VARIANTS[@]}"; do
|
||||
for size in "${SIZE_VARIANTS[@]}"; do
|
||||
for scheme in "${SCHEME_VARIANTS[@]}"; do
|
||||
uninstall "${dest:-$DEST_DIR}" "${name:-$THEME_NAME}" "$theme" "$color" "$size" "$scheme"
|
||||
done
|
||||
done
|
||||
done
|
||||
done
|
||||
}
|
||||
|
||||
clean_theme() {
|
||||
if [[ "$UID" != "$ROOT_UID" ]]; then
|
||||
if [[ "$DEST_DIR" == "$HOME/.themes" ]]; then
|
||||
local dest="$HOME/.local/share/themes"
|
||||
elif [[ "$DEST_DIR" == "$XDG_DATA_HOME/themes" || "$DEST_DIR" == "$HOME/.local/share/themes" ]]; then
|
||||
local dest="$HOME/.themes"
|
||||
fi
|
||||
|
||||
for theme in "${themes[@]}"; do
|
||||
for color in "${colors[@]}"; do
|
||||
for size in "${sizes[@]}"; do
|
||||
for scheme in "${schemes[@]}"; do
|
||||
uninstall "${dest}" "${name:-$THEME_NAME}" "$theme" "$color" "$size" "$scheme"
|
||||
done
|
||||
done
|
||||
done
|
||||
done
|
||||
fi
|
||||
}
|
||||
|
||||
if [[ "$uninstall" == 'true' ]]; then
|
||||
if [[ "$libadwaita" == 'true' ]]; then
|
||||
echo -e "\nUninstall libadwaita theme from ${HOME}/.config/gtk-4.0 ..."
|
||||
@@ -707,7 +759,7 @@ if [[ "$uninstall" == 'true' ]]; then
|
||||
fi
|
||||
else
|
||||
install_package && tweaks_temp
|
||||
gnome_shell_version && echo && install_theme
|
||||
gnome_shell_version && echo && clean_theme && install_theme
|
||||
|
||||
if [[ "$libadwaita" == 'true' ]]; then
|
||||
uninstall_libadwaita && install_libadwaita
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
{ lib
|
||||
, stdenv
|
||||
, bash
|
||||
, coreutils
|
||||
, sassc
|
||||
, ...
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation {
|
||||
pname = "colloid-gtk-theme";
|
||||
version = "nix";
|
||||
|
||||
src = ../.;
|
||||
|
||||
nativeBuildInputs = [
|
||||
bash
|
||||
coreutils
|
||||
sassc
|
||||
];
|
||||
|
||||
patchPhase = ''
|
||||
patchShebangs install.sh
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
HOME="$TMPDIR" ./install.sh \
|
||||
--dest $out/share/themes
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
meta = {
|
||||
description = "Colloid GTK Theme";
|
||||
license = lib.licenses.gpl3;
|
||||
platforms = lib.platforms.linux;
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
#! /bin/bash
|
||||
|
||||
THEME_DIR=$(cd $(dirname $0) && pwd)
|
||||
|
||||
THEME_NAME=Colloid
|
||||
|
||||
_THEME_VARIANTS=('' '-Purple' '-Pink' '-Red' '-Orange' '-Yellow' '-Green' '-Teal' '-Grey')
|
||||
_SCHEME_VARIANTS=('' '-Nord' '-Dracula' '-Gruvbox' '-Everforest' '-Catppuccin')
|
||||
_COLOR_VARIANTS=('' '-Light' '-Dark')
|
||||
_SIZE_VARIANTS=('' '-Compact')
|
||||
|
||||
if [ ! -z "${COLOR_VARIANTS:-}" ]; then
|
||||
IFS=', ' read -r -a _COLOR_VARIANTS <<< "${COLOR_VARIANTS:-}"
|
||||
fi
|
||||
|
||||
if [ ! -z "${SCHEME_VARIANTS:-}" ]; then
|
||||
IFS=', ' read -r -a _SCHEME_VARIANTS <<< "${SCHEME_VARIANTS:-}"
|
||||
fi
|
||||
|
||||
if [ ! -z "${THEME_VARIANTS:-}" ]; then
|
||||
IFS=', ' read -r -a _THEME_VARIANTS <<< "${THEME_VARIANTS:-}"
|
||||
fi
|
||||
|
||||
if [ ! -z "${SIZE_VARIANTS:-}" ]; then
|
||||
IFS=', ' read -r -a _SIZE_VARIANTS <<< "${SIZE_VARIANTS:-}"
|
||||
fi
|
||||
|
||||
Tar_themes() {
|
||||
for scheme in "${_SCHEME_VARIANTS[@]}"; do
|
||||
rm -rf ${THEME_NAME}${scheme}.tar
|
||||
rm -rf ${THEME_NAME}${scheme}.tar.xz
|
||||
done
|
||||
|
||||
for scheme in "${_SCHEME_VARIANTS[@]}"; do
|
||||
tar -Jcvf ${THEME_NAME}${theme}${scheme}.tar.xz ${THEME_NAME}{'','-Purple','-Pink','-Red','-Orange','-Yellow','-Green','-Teal','-Grey'}{'','-Light','-Dark'}${scheme}
|
||||
done
|
||||
}
|
||||
|
||||
Clear_theme() {
|
||||
for theme in "${_THEME_VARIANTS[@]}"; do
|
||||
for color in "${_COLOR_VARIANTS[@]}"; do
|
||||
for scheme in "${_SCHEME_VARIANTS[@]}"; do
|
||||
rm -rf ${THEME_NAME}${theme}${color}${scheme}{'','-hdpi','-xhdpi'}
|
||||
done
|
||||
done
|
||||
done
|
||||
}
|
||||
|
||||
cd .. && ./install.sh -d $THEME_DIR --tweaks all -t all
|
||||
cd $THEME_DIR && Tar_themes && Clear_theme
|
||||
|
||||
|
Before Width: | Height: | Size: 522 B After Width: | Height: | Size: 522 B |
|
Before Width: | Height: | Size: 475 B After Width: | Height: | Size: 469 B |
|
Before Width: | Height: | Size: 522 B After Width: | Height: | Size: 522 B |
|
Before Width: | Height: | Size: 512 B After Width: | Height: | Size: 512 B |
|
Before Width: | Height: | Size: 445 B After Width: | Height: | Size: 445 B |
|
Before Width: | Height: | Size: 383 B After Width: | Height: | Size: 402 B |
|
Before Width: | Height: | Size: 445 B After Width: | Height: | Size: 445 B |
|
Before Width: | Height: | Size: 439 B After Width: | Height: | Size: 439 B |
|
Before Width: | Height: | Size: 327 B After Width: | Height: | Size: 327 B |
|
Before Width: | Height: | Size: 337 B After Width: | Height: | Size: 337 B |
|
Before Width: | Height: | Size: 423 B After Width: | Height: | Size: 423 B |
|
Before Width: | Height: | Size: 422 B After Width: | Height: | Size: 423 B |
|
Before Width: | Height: | Size: 461 B After Width: | Height: | Size: 461 B |
|
Before Width: | Height: | Size: 333 B After Width: | Height: | Size: 337 B |
|
Before Width: | Height: | Size: 363 B After Width: | Height: | Size: 363 B |
|
Before Width: | Height: | Size: 355 B After Width: | Height: | Size: 365 B |
|
Before Width: | Height: | Size: 398 B After Width: | Height: | Size: 398 B |
|
Before Width: | Height: | Size: 333 B After Width: | Height: | Size: 337 B |
|
Before Width: | Height: | Size: 363 B After Width: | Height: | Size: 363 B |
|
Before Width: | Height: | Size: 136 B After Width: | Height: | Size: 136 B |
|
Before Width: | Height: | Size: 478 B After Width: | Height: | Size: 478 B |
|
Before Width: | Height: | Size: 408 B After Width: | Height: | Size: 431 B |
|
Before Width: | Height: | Size: 478 B After Width: | Height: | Size: 478 B |
|
Before Width: | Height: | Size: 473 B After Width: | Height: | Size: 473 B |
|
Before Width: | Height: | Size: 445 B After Width: | Height: | Size: 445 B |
|
Before Width: | Height: | Size: 383 B After Width: | Height: | Size: 402 B |
|
Before Width: | Height: | Size: 445 B After Width: | Height: | Size: 445 B |
|
Before Width: | Height: | Size: 439 B After Width: | Height: | Size: 439 B |
|
Before Width: | Height: | Size: 164 B After Width: | Height: | Size: 164 B |
|
Before Width: | Height: | Size: 529 B After Width: | Height: | Size: 529 B |
|
Before Width: | Height: | Size: 449 B After Width: | Height: | Size: 478 B |
|
Before Width: | Height: | Size: 290 B After Width: | Height: | Size: 290 B |
|
Before Width: | Height: | Size: 162 B After Width: | Height: | Size: 162 B |
|
Before Width: | Height: | Size: 243 B After Width: | Height: | Size: 243 B |
|
Before Width: | Height: | Size: 262 B After Width: | Height: | Size: 262 B |
|
Before Width: | Height: | Size: 258 B After Width: | Height: | Size: 258 B |
|
Before Width: | Height: | Size: 246 B After Width: | Height: | Size: 246 B |
|
Before Width: | Height: | Size: 127 B After Width: | Height: | Size: 127 B |
|
Before Width: | Height: | Size: 518 B After Width: | Height: | Size: 522 B |
|
Before Width: | Height: | Size: 477 B After Width: | Height: | Size: 471 B |
|
Before Width: | Height: | Size: 518 B After Width: | Height: | Size: 522 B |
|
Before Width: | Height: | Size: 512 B After Width: | Height: | Size: 512 B |
|
Before Width: | Height: | Size: 445 B After Width: | Height: | Size: 445 B |
|
Before Width: | Height: | Size: 389 B After Width: | Height: | Size: 389 B |
|
Before Width: | Height: | Size: 445 B After Width: | Height: | Size: 445 B |
|
Before Width: | Height: | Size: 439 B After Width: | Height: | Size: 439 B |
|
Before Width: | Height: | Size: 326 B After Width: | Height: | Size: 326 B |
|
Before Width: | Height: | Size: 337 B After Width: | Height: | Size: 337 B |
|
Before Width: | Height: | Size: 423 B After Width: | Height: | Size: 423 B |
|
Before Width: | Height: | Size: 439 B After Width: | Height: | Size: 424 B |
|
Before Width: | Height: | Size: 461 B After Width: | Height: | Size: 461 B |
|
Before Width: | Height: | Size: 342 B After Width: | Height: | Size: 338 B |
|
Before Width: | Height: | Size: 363 B After Width: | Height: | Size: 363 B |
|
Before Width: | Height: | Size: 371 B After Width: | Height: | Size: 367 B |
|
Before Width: | Height: | Size: 398 B After Width: | Height: | Size: 398 B |
|
Before Width: | Height: | Size: 342 B After Width: | Height: | Size: 338 B |
|
Before Width: | Height: | Size: 363 B After Width: | Height: | Size: 363 B |
|
Before Width: | Height: | Size: 136 B After Width: | Height: | Size: 136 B |
|
Before Width: | Height: | Size: 478 B After Width: | Height: | Size: 478 B |
|
Before Width: | Height: | Size: 419 B After Width: | Height: | Size: 418 B |
|
Before Width: | Height: | Size: 478 B After Width: | Height: | Size: 478 B |
|
Before Width: | Height: | Size: 473 B After Width: | Height: | Size: 473 B |
|
Before Width: | Height: | Size: 445 B After Width: | Height: | Size: 445 B |
|
Before Width: | Height: | Size: 389 B After Width: | Height: | Size: 389 B |
|
Before Width: | Height: | Size: 445 B After Width: | Height: | Size: 445 B |
|
Before Width: | Height: | Size: 439 B After Width: | Height: | Size: 439 B |
|
Before Width: | Height: | Size: 164 B After Width: | Height: | Size: 164 B |
|
Before Width: | Height: | Size: 531 B After Width: | Height: | Size: 537 B |
|
Before Width: | Height: | Size: 478 B After Width: | Height: | Size: 454 B |
|
Before Width: | Height: | Size: 290 B After Width: | Height: | Size: 290 B |
|
Before Width: | Height: | Size: 162 B After Width: | Height: | Size: 162 B |
|
Before Width: | Height: | Size: 243 B After Width: | Height: | Size: 243 B |
|
Before Width: | Height: | Size: 262 B After Width: | Height: | Size: 262 B |
|
Before Width: | Height: | Size: 258 B After Width: | Height: | Size: 258 B |
|
Before Width: | Height: | Size: 246 B After Width: | Height: | Size: 246 B |
|
Before Width: | Height: | Size: 127 B After Width: | Height: | Size: 127 B |
|
Before Width: | Height: | Size: 522 B After Width: | Height: | Size: 518 B |
|
Before Width: | Height: | Size: 475 B After Width: | Height: | Size: 477 B |
|
Before Width: | Height: | Size: 522 B After Width: | Height: | Size: 518 B |
|
Before Width: | Height: | Size: 512 B After Width: | Height: | Size: 512 B |
|
Before Width: | Height: | Size: 445 B After Width: | Height: | Size: 445 B |
|
Before Width: | Height: | Size: 383 B After Width: | Height: | Size: 389 B |
|
Before Width: | Height: | Size: 445 B After Width: | Height: | Size: 445 B |
|
Before Width: | Height: | Size: 439 B After Width: | Height: | Size: 439 B |
|
Before Width: | Height: | Size: 327 B After Width: | Height: | Size: 327 B |
|
Before Width: | Height: | Size: 337 B After Width: | Height: | Size: 337 B |
|
Before Width: | Height: | Size: 423 B After Width: | Height: | Size: 423 B |