forked from xCaptaiN09/pixie-sddm
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·95 lines (81 loc) · 2.71 KB
/
install.sh
File metadata and controls
executable file
·95 lines (81 loc) · 2.71 KB
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
#!/bin/bash
# Pixie SDDM - Universal Smart Installer
# Author: xCaptaiN09
set -e
THEME_NAME="pixie"
THEME_DIR="/usr/share/sddm/themes/${THEME_NAME}"
FONT_DEST="/usr/share/fonts/${THEME_NAME}-fonts"
# Colors
GREEN='\033[0;32m'
BLUE='\033[0;34m'
YELLOW='\033[0;33m'
RED='\033[0;31m'
NC='\033[0m' # No Color
echo -e "${BLUE}==>${NC} Starting Pixie SDDM Installation..."
# 1. SYSTEM DETECTION
if command -v sddm-greeter-qt6 >/dev/null 2>&1; then
SYSTEM_QT="6"
GREETER_CMD="sddm-greeter-qt6"
TARGET_BRANCH="main"
echo -e "${BLUE}==>${NC} System detected: ${GREEN}Qt6 (Modern)${NC}"
else
SYSTEM_QT="5"
GREETER_CMD="sddm-greeter"
TARGET_BRANCH="qt5"
echo -e "${BLUE}==>${NC} System detected: ${YELLOW}Qt5 (Legacy)${NC}"
fi
# 2. AUTO-VERSION SWITCH (Git Only)
if [ -d .git ]; then
CURRENT_BRANCH=$(git branch --show-current)
if [ "$CURRENT_BRANCH" != "$TARGET_BRANCH" ]; then
echo -e "${YELLOW}==>${NC} System requires ${GREEN}${TARGET_BRANCH}${NC} version. Switching branch..."
git checkout "$TARGET_BRANCH"
# Re-run the script from the new branch to ensure we use the right files
exec ./install.sh
fi
fi
# 3. NIXOS CHECK
if [ -f /etc/NIXOS ]; then
echo -e "${RED}Warning:${NC} NixOS detected. Please use the declarative method in your config."
exit 1
fi
# 4. ROOT CHECK
if [ "$EUID" -ne 0 ]; then
echo -e "${RED}Error:${NC} Please run as root (use sudo)."
exit 1
fi
# 5. INSTALLATION
if [ -d "${THEME_DIR}" ]; then
echo -e "${BLUE}==>${NC} Cleaning old version..."
rm -rf "${THEME_DIR}"
fi
echo -e "${BLUE}==>${NC} Installing Pixie (Qt${SYSTEM_QT}) to ${THEME_DIR}..."
mkdir -p "${THEME_DIR}"
cp -r assets components Main.qml metadata.desktop theme.conf LICENSE "${THEME_DIR}/"
chmod -R 755 "${THEME_DIR}"
# 5.1. FONT INSTALLATION
if [ -d "assets/fonts" ] && [ "$(ls -A assets/fonts/*.ttf 2>/dev/null)" ]; then
echo -e "${BLUE}==>${NC} Installing theme fonts..."
mkdir -p "$FONT_DEST"
cp assets/fonts/*.ttf "$FONT_DEST/"
chmod 755 "$FONT_DEST"
chmod 644 "$FONT_DEST"/*.ttf
if command -v fc-cache >/dev/null 2>&1; then
fc-cache -f "$FONT_DEST"
fi
else
echo -e "${YELLOW}==>${NC} No fonts found in assets/fonts, skipping..."
fi
# 6. CONFIGURATION
echo -e ""
read -p "Apply Pixie as your active theme now? (y/N) " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
mkdir -p /etc/sddm.conf.d
echo -e "[Theme]\nCurrent=${THEME_NAME}" | tee /etc/sddm.conf.d/theme.conf > /dev/null
echo -e "${GREEN}Theme applied successfully!${NC}"
else
echo -e "To apply manually, set ${GREEN}Current=${THEME_NAME}${NC} in your SDDM config."
fi
echo -e ""
echo -e "Test with: ${BLUE}${GREETER_CMD} --test-mode --theme ${THEME_DIR}${NC}"