This commit is contained in:
vinceliuice
2025-05-09 23:46:58 +08:00
19 changed files with 1316 additions and 6 deletions

View File

@@ -0,0 +1 @@
whatsapp.svg

View File

@@ -1 +0,0 @@
web-whatsapp.svg

View File

@@ -0,0 +1 @@
birdtray.svg

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 22 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 9.6 KiB

View File

@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<svg xmlns="http://www.w3.org/2000/svg" width="64" height="64" image-rendering="optimizeSpeed">
<g transform="matrix(1, 0, 0, 1, -7.612477, 27.6166)">
<rect width="56.002" height="56.002" x="12.121" y="-23.507" fill="#5a5a5a" rx="13.002" ry="13.002"/>
<circle cx="40.141" cy="4.568" r="30.001" fill="none"/>
<path d="M 12.119 18.522 L 12.119 19.522 C 12.119 26.725 17.919 32.526 25.123 32.526 L 55.119 32.526 C 62.322 32.526 68.123 26.726 68.123 19.522 L 68.123 18.522 C 68.123 25.725 62.323 31.524 55.119 31.524 L 25.123 31.524 C 17.936 31.54 12.105 25.71 12.119 18.522" opacity=".15"/>
<path fill="#fff" d="M 12.119 -9.472 L 12.119 -10.472 C 12.119 -17.675 17.919 -23.476 25.123 -23.476 L 55.119 -23.476 C 62.322 -23.476 68.123 -17.676 68.123 -10.472 L 68.123 -9.472 C 68.123 -16.675 62.323 -22.474 55.119 -22.474 L 25.123 -22.474 C 17.936 -22.49 12.105 -16.66 12.119 -9.472" opacity=".15"/>
</g>
<g transform="matrix(0.744286, 0, 0, 0.714895, -38.484772, 12.42059)" style="">
<path style="opacity:0.2" d="M 95.253 1.187 C 79.789 1.187 67.253 13.263 67.253 28.16 C 67.257 32.761 68.483 37.284 70.813 41.3 L 68.662 49.527 L 68.379 50.638 C 67.82 52.835 69.83 55.613 72.11 55.133 L 72.11 55.133 L 82.778 52.295 C 86.652 54.158 90.923 55.129 95.253 55.133 C 110.717 55.133 123.253 43.056 123.253 28.16 C 123.253 13.263 110.717 1.187 95.253 1.187 Z"/>
<path style="fill:#e4e4e4" d="M 95.253 0.187 C 79.789 0.187 67.253 12.263 67.253 27.16 C 67.257 31.761 68.483 36.284 70.813 40.3 L 68.662 48.527 L 68.379 49.638 C 67.82 51.835 69.83 54.613 72.11 54.133 L 72.11 54.133 L 82.778 51.295 C 86.652 53.158 90.923 54.129 95.253 54.133 C 110.717 54.133 123.253 42.056 123.253 27.16 C 123.253 12.263 110.717 0.187 95.253 0.187 Z"/>
<path style="opacity:0.1" d="M 95.253 5.187 C 87.646 5.19 80.489 8.649 75.966 14.511 L 96.371 15.491 L 71.311 26.672 C 71.274 27.176 71.254 27.682 71.253 28.187 C 71.253 40.89 81.998 51.187 95.253 51.187 C 103.889 51.186 111.858 46.738 116.121 39.541 L 95.756 38.563 L 119.253 28.079 C 119.191 15.42 108.464 5.188 95.253 5.187 Z"/>
<path style="fill:#2bae39" d="M 95.253 4.187 C 87.646 4.19 80.489 7.649 75.966 13.511 L 96.371 14.491 L 71.311 25.672 C 71.274 26.176 71.254 26.682 71.253 27.187 C 71.253 39.89 81.998 50.187 95.253 50.187 C 103.889 50.186 111.858 45.738 116.121 38.541 L 95.756 37.563 L 119.253 27.079 C 119.191 14.42 108.464 4.188 95.253 4.187 Z"/>
<path style="fill:#ffffff;opacity:0.2" d="M 95.253 0.187 C 79.789 0.187 67.253 12.263 67.253 27.16 C 67.253 27.307 67.266 27.453 67.268 27.6 C 67.579 12.963 79.984 1.187 95.253 1.187 C 110.542 1.187 122.961 12.995 123.239 27.66 C 123.242 27.493 123.253 27.328 123.253 27.16 C 123.253 12.263 110.716 0.187 95.253 0.187 Z M 70.637 40.973 L 68.663 48.527 L 68.379 49.639 C 68.273 50.058 68.26 50.498 68.325 50.934 C 68.34 50.834 68.355 50.736 68.379 50.639 L 68.663 49.527 L 70.813 41.299 C 70.751 41.192 70.698 41.081 70.637 40.973 Z"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.9 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 9.3 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 8.1 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 7.0 KiB

After

Width:  |  Height:  |  Size: 6.9 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 12 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 11 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 7.7 KiB

After

Width:  |  Height:  |  Size: 7.9 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 13 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 7.8 KiB

After

Width:  |  Height:  |  Size: 8.3 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 7.9 KiB

After

Width:  |  Height:  |  Size: 8.3 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 8.8 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 8.5 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 7.3 KiB

After

Width:  |  Height:  |  Size: 8.4 KiB

375
tui_installer.sh Executable file
View File

@@ -0,0 +1,375 @@
#!/bin/bash
# Repository
REPO="Burhanverse/colloid-icon-theme"
# Color codes
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
MAGENTA='\033[0;35m'
CYAN='\033[0;36m'
NC='\033[0m'
# Script variables
SCHEME=""
THEME=""
NOTINT_FLAG=""
TAG=""
TEMP_DIR=$(mktemp -d)
# Show help message
show_help() {
echo -e "${BLUE}Colloid Icon Theme Installer${NC}"
echo "Usage: $0 [OPTIONS]"
echo
echo "Options:"
echo " -h, --help Show this help message"
echo " -s, --scheme VALUE Set colorscheme (default, nord, dracula, gruvbox, everforest, catppuccin, all)"
echo " -t, --theme VALUE Set folder color theme (default, purple, pink, red, orange, yellow, green, teal, grey, all)"
echo " -n, --notint Disable KDE Plasma color tinting"
echo " -y, --yes Non-interactive mode (uses default options)"
echo
}
# Check for dependencies
check_dependencies() {
local missing_deps=()
for cmd in curl unzip; do
if ! command -v "$cmd" &>/dev/null; then
missing_deps+=("$cmd")
fi
done
if [ ${#missing_deps[@]} -gt 0 ]; then
echo -e "${RED}Error: Required dependencies not found: ${missing_deps[*]}${NC}"
echo -e "${YELLOW}Please install them and run this script again.${NC}"
exit 1
fi
}
# Clean up function
clean_up() {
echo -e "${CYAN}Cleaning up temporary files...${NC}"
rm -rf "$TEMP_DIR"
}
# Set up trap for unexpected exits
trap clean_up EXIT INT TERM
get_latest_release_tag() {
echo -e "${CYAN}Fetching the latest release tag...${NC}"
# First try GitHub API with expanded error handling
local api_response
api_response=$(curl --silent -i "https://api.github.com/repos/$REPO/releases/latest")
# Check HTTP status code
local status_code
status_code=$(echo "$api_response" | head -n 1 | grep -o "HTTP/[0-9.]* [0-9]*" | cut -d' ' -f2)
case "$status_code" in
200)
# Success - extract tag
TAG=$(echo "$api_response" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/')
;;
404)
echo -e "${YELLOW}No releases found for $REPO. Trying tags instead...${NC}"
# Try to get tags as fallback
local tags_response
tags_response=$(curl --silent "https://api.github.com/repos/$REPO/tags")
if [ "$tags_response" != "[]" ] && [ -n "$tags_response" ]; then
TAG=$(echo "$tags_response" | grep -m1 '"name":' | sed -E 's/.*"([^"]+)".*/\1/')
fi
;;
403)
echo -e "${YELLOW}GitHub API rate limit exceeded. Trying alternative method...${NC}"
# Skip to fallback
;;
*)
echo -e "${YELLOW}GitHub API returned status code: $status_code. Trying alternative method...${NC}"
# Skip to fallback
;;
esac
# If API methods failed, try HTML scraping as last resort
if [ -z "$TAG" ]; then
echo -e "${YELLOW}Trying alternative method to get latest tag...${NC}"
TAG=$(curl --silent "https://github.com/$REPO/releases" |
grep -o 'href="/'$REPO'/releases/tag/[^"]*' |
head -1 |
sed 's|href="/'$REPO'/releases/tag/||')
fi
# If we still don't have a tag, try direct download of main branch as last resort
if [ -z "$TAG" ]; then
echo -e "${YELLOW}No release tags found. Using main branch instead.${NC}"
TAG="main"
# Adjust download URL in download_latest_release function
USE_MAIN_BRANCH=true
return
fi
echo -e "${GREEN}Latest release tag is: $TAG${NC}"
}
# Update download_latest_release to handle main branch fallback
download_latest_release() {
if [ "${USE_MAIN_BRANCH:-false}" = true ]; then
DOWNLOAD_URL="https://github.com/$REPO/archive/refs/heads/main.zip"
echo -e "${CYAN}Downloading main branch from ${DOWNLOAD_URL}...${NC}"
else
DOWNLOAD_URL="https://github.com/$REPO/archive/refs/tags/$TAG.zip"
echo -e "${CYAN}Downloading the release from ${DOWNLOAD_URL}...${NC}"
fi
# Use progress bar with curl
if ! curl -L --progress-bar -o "$TEMP_DIR/latest_release.zip" "$DOWNLOAD_URL"; then
echo -e "${RED}Failed to download from GitHub. Please check your internet connection.${NC}"
exit 1
fi
echo -e "${CYAN}Extracting the zip file...${NC}"
if ! unzip -q -o "$TEMP_DIR/latest_release.zip" -d "$TEMP_DIR"; then
echo -e "${RED}Failed to extract the zip file.${NC}"
exit 1
fi
EXTRACTED_DIR=$(unzip -Z -1 "$TEMP_DIR/latest_release.zip" | head -n 1 | cut -d '/' -f 1)
if [ -z "$EXTRACTED_DIR" ]; then
echo -e "${RED}Could not determine extracted directory.${NC}"
exit 1
fi
cd "$TEMP_DIR/$EXTRACTED_DIR" || {
echo -e "${RED}Failed to change directory to $TEMP_DIR/$EXTRACTED_DIR${NC}"
exit 1
}
}
remove_old_directories() {
echo -e "${CYAN}Checking for old Colloid-icon-theme directories...${NC}"
# Use nullglob to handle the case where no matching directories are found
shopt -s nullglob
for dir in Colloid-icon-theme-*; do
if [[ -d "$dir" ]]; then
echo -e "${RED}Removing existing directory: $dir${NC}"
rm -rf "$dir"
fi
done
shopt -u nullglob
}
# Colorscheme
choose_scheme() {
if [ -n "$SCHEME" ]; then
return
fi
echo -e "${YELLOW}Choose a folder colorscheme variant:${NC}"
echo -e "1) ${GREEN}Default${NC}"
echo -e "2) ${GREEN}Nord${NC}"
echo -e "3) ${GREEN}Dracula${NC}"
echo -e "4) ${GREEN}Gruvbox${NC}"
echo -e "5) ${GREEN}Everforest${NC}"
echo -e "6) ${GREEN}Catppuccin${NC}"
echo -e "7) ${GREEN}All${NC}"
echo -e -n "${MAGENTA}Enter your choice [1-7]: ${NC}"
read -r scheme_choice
case $scheme_choice in
1) SCHEME="default" ;;
2) SCHEME="nord" ;;
3) SCHEME="dracula" ;;
4) SCHEME="gruvbox" ;;
5) SCHEME="everforest" ;;
6) SCHEME="catppuccin" ;;
7) SCHEME="all" ;;
*) echo -e "${RED}Invalid choice! Defaulting to 'default'.${NC}"; SCHEME="default" ;;
esac
}
# Folder color variant
choose_theme() {
if [ -n "$THEME" ]; then
return
fi
echo -e "${YELLOW}Choose a folder color variant:${NC}"
echo -e "1) ${GREEN}Blue (Default)${NC}"
echo -e "2) ${GREEN}Purple${NC}"
echo -e "3) ${GREEN}Pink${NC}"
echo -e "4) ${GREEN}Red${NC}"
echo -e "5) ${GREEN}Orange${NC}"
echo -e "6) ${GREEN}Yellow${NC}"
echo -e "7) ${GREEN}Green${NC}"
echo -e "8) ${GREEN}Teal${NC}"
echo -e "9) ${GREEN}Grey${NC}"
echo -e "10) ${GREEN}All${NC}"
echo -e -n "${MAGENTA}Enter your choice [1-10]: ${NC}"
read -r theme_choice
case $theme_choice in
1) THEME="default" ;;
2) THEME="purple" ;;
3) THEME="pink" ;;
4) THEME="red" ;;
5) THEME="orange" ;;
6) THEME="yellow" ;;
7) THEME="green" ;;
8) THEME="teal" ;;
9) THEME="grey" ;;
10) THEME="all" ;;
*) echo -e "${RED}Invalid choice! Defaulting to 'default'.${NC}"; THEME="default" ;;
esac
}
# KDE Plasma tinting option
is_kde() {
if [[ "$(echo "$XDG_CURRENT_DESKTOP" | tr '[:upper:]' '[:lower:]')" == *"kde"* ||
"$(echo "$XDG_SESSION_DESKTOP" | tr '[:upper:]' '[:lower:]')" == *"kde"* ]]; then
return 0
else
return 1
fi
}
is_gnome() {
if [[ "$(echo "$XDG_CURRENT_DESKTOP" | tr '[:upper:]' '[:lower:]')" == *"gnome"* ||
"$(echo "$XDG_SESSION_DESKTOP" | tr '[:upper:]' '[:lower:]')" == *"gnome"* ]]; then
return 0
else
return 1
fi
}
choose_notint() {
# If notint flag is already set via command line, skip this
if [ -n "$NOTINT_FLAG" ]; then
return
fi
if is_kde; then
echo -e "${YELLOW}Disable Follow ColorScheme for folders on KDE Plasma?${NC}"
echo -e "1) ${GREEN}Yes${NC}"
echo -e "2) ${GREEN}No${NC}"
echo -e -n "${MAGENTA}Enter your choice [1-2]: ${NC}"
read -r notint_choice
case $notint_choice in
1) NOTINT_FLAG="--notint" ;;
2) NOTINT_FLAG="" ;;
*) echo -e "${RED}Invalid choice! Defaulting to 'No'.${NC}"; NOTINT_FLAG="" ;;
esac
else
echo -e "${CYAN}Not running KDE Plasma. Skipping tinting option.${NC}"
NOTINT_FLAG=""
fi
}
# Set defaults for non-interactive mode
set_defaults() {
SCHEME="default"
THEME="default"
NOTINT_FLAG=""
if is_kde; then
NOTINT_FLAG="" # Default behavior for KDE
fi
}
# Parse command line arguments
parse_arguments() {
while [[ $# -gt 0 ]]; do
case "$1" in
-h|--help)
show_help
exit 0
;;
-s|--scheme)
SCHEME="$2"
shift 2
;;
-t|--theme)
THEME="$2"
shift 2
;;
-n|--notint)
NOTINT_FLAG="--notint"
shift
;;
-y|--yes)
NON_INTERACTIVE=true
shift
;;
*)
echo -e "${RED}Unknown option: $1${NC}"
show_help
exit 1
;;
esac
done
# Validate scheme and theme if provided
if [ -n "$SCHEME" ]; then
case "$SCHEME" in
default|nord|dracula|gruvbox|everforest|catppuccin|all) ;;
*)
echo -e "${RED}Invalid scheme: $SCHEME${NC}"
exit 1
;;
esac
fi
if [ -n "$THEME" ]; then
case "$THEME" in
default|purple|pink|red|orange|yellow|green|teal|grey|all) ;;
*)
echo -e "${RED}Invalid theme: $THEME${NC}"
exit 1
;;
esac
fi
}
# Main
main() {
check_dependencies
parse_arguments "$@"
echo -e "${BLUE}Starting Colloid Icon Theme Installer...${NC}"
# Set defaults in non-interactive mode
if [ "${NON_INTERACTIVE:-false}" = true ]; then
set_defaults
fi
get_latest_release_tag
# Get user choices if not in non-interactive mode
if [ "${NON_INTERACTIVE:-false}" != true ]; then
choose_scheme
choose_theme
choose_notint
fi
remove_old_directories
download_latest_release
# Create installation command
INSTALL_CMD="./install.sh -s \"$SCHEME\" -t \"$THEME\""
if [ -n "$NOTINT_FLAG" ]; then
INSTALL_CMD="$INSTALL_CMD $NOTINT_FLAG"
fi
echo -e "${CYAN}Running the install script...${NC}"
echo -e "${YELLOW}Command: $INSTALL_CMD${NC}"
eval "$INSTALL_CMD"
cd - > /dev/null
echo -e "${GREEN}Installation completed successfully.${NC}"
}
main "$@"