summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: c29261bf78f7f5244f23d6388a2e8779723a672b (plain)
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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
# Maintainer: PolJak <polesnik.jaka@gmail.com>

pkgname=polland-de-minimal
pkgver=1.0.0
pkgrel=1
pkgdesc="A desktop environment built on top of the shoulders of giants and the personality of some guy somewhere. Built on top of hyprland. Comes with minimal extra dependencies apart from function giving ones."
arch=('x86_64' 'aarch64')
url="https://github.com/Pol-Jak-295/PolLand"
license=('AGPL')
depends=('hyprland' 'rofi' 'waybar' 'kitty' 'awww' 'swaync' 'hyprlock' 'nwg-bar' 'sddm' 'sddm-sugar-candy-git' 'darkman' 'playerctl' 'brightnessctl' 'wireplumber' 'pipewire' 'pipewire-pulse' 'kexec-tools' 'nautilus' 'hyprpolkitagent' 'xdg-desktop-portal-hyprland' 'wl-clipboard')
makedepends=('git')
provides=('polland-de')
conflicts=('polland-de')
source=("git+https://github.com/Pol-Jak-295/polland.git")
sha256sums=('SKIP')
install='polland-de.install'

package() {
    cd "$srcdir/polland"
    
    # === SYSTEM CONFIGS (source of truth) ===
    mkdir -p "$pkgdir/usr/share/polland/configs"
    
    config_dirs=( "hypr" "waybar" "rofi" "kitty" "nvim" "gtk-3.0" "gtk-4.0" "images" "nwg-bar" "fastfetch" "swaync")
    
    for dir in "${config_dirs[@]}"; do
        if [ -d "$srcdir/polland/$dir" ]; then
            cp -r "$srcdir/polland/$dir" "$pkgdir/usr/share/polland/configs/"
        fi
    done
    
    # Shell configs
    for file in ".zshrc" ".zshrc.core" ".zshrc.aliases" ".zshrc.functions" ".zprofile"; do
        if [ -f "$srcdir/polland/$file" ]; then
            cp "$srcdir/polland/$file" "$pkgdir/usr/share/polland/configs/"
        fi
    done
    
    # === SKEL FOR NEW USERS ===
    mkdir -p "$pkgdir/etc/skel/.config"
    for dir in "${config_dirs[@]}"; do
        if [ -d "$srcdir/polland/$dir" ]; then
            cp -r "$srcdir/polland/$dir" "$pkgdir/etc/skel/.config/"
        fi
    done
    
    for file in ".zshrc" ".zshrc.core" ".zshrc.aliases" ".zshrc.functions" ".zprofile"; do
        if [ -f "$srcdir/polland/$file" ]; then
            cp "$srcdir/polland/$file" "$pkgdir/etc/skel/"
        fi
    done
    
    # === ROOT STUFF ===
    # SDDM config
    if [ -f "$srcdir/polland/etc/sddm.conf" ]; then
        mkdir -p "$pkgdir/etc/sddm.conf.d"
        cp "$srcdir/polland/etc/sddm.conf" "$pkgdir/etc/sddm.conf.d/99-polland.conf"
    fi
    
    # Wallpapers
    if [ -d "$srcdir/polland/images" ]; then
        mkdir -p "$pkgdir/usr/share/wallpapers"
        cp -r "$srcdir/polland/images/"* "$pkgdir/usr/share/wallpapers/" 2>/dev/null || true
    fi
    
    # SDDM theme
    if [ -d "$srcdir/polland/sugar-candy" ]; then
        mkdir -p "$pkgdir/usr/share/sddm/themes"
        cp -r "$srcdir/polland/sugar-candy" "$pkgdir/usr/share/sddm/themes/"
    fi
    
    # nwg-bar icons
    if [ -d "$srcdir/polland/nwg-bar/icons" ]; then
        mkdir -p "$pkgdir/usr/share/nwg-bar/images"
        cp -r "$srcdir/polland/nwg-bar/icons" "$pkgdir/usr/share/nwg-bar/images/"
    fi
    
    # === INSTALL SYNC SCRIPT ===
    mkdir -p "$pkgdir/usr/lib/polland"
    
    cat > "$pkgdir/usr/lib/polland/sync-user-config.sh" << 'EOF'
#!/bin/bash
# Polland v1 - Simple config sync
# WARNING: This overwrites existing configs with package defaults
# No backups, no merging - just fresh configs

REPO_CONFIGS="/usr/share/polland/configs"
USER_CONFIGS="$HOME/.config"

echo "🏰 Installing PolLand configs..."

# Confirm with user
echo ""
echo "⚠️  WARNING: This will OVERWRITE your current configs in:"
echo "   $USER_CONFIGS/"
echo ""
echo "   Your existing configs will be DELETED."
echo ""
read -p "Continue? [y/N] " -n 1 -r
echo ""
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
    echo "❌ Aborted."
    exit 1
fi

config_dirs=( "hypr" "waybar" "rofi" "kitty" "nvim" "gtk-3.0" "gtk-4.0" "images" "nwg-bar" "fastfetch" "swaync")

for dir in "${config_dirs[@]}"; do
    if [ -d "$REPO_CONFIGS/$dir" ]; then
        mkdir -p "$USER_CONFIGS"
        # Remove existing config
        rm -rf "$USER_CONFIGS/$dir"
        # Copy fresh configs
        cp -r "$REPO_CONFIGS/$dir" "$USER_CONFIGS/"
        echo "  ✅ Installed $dir"
    fi
done

# Shell configs
shell_files=( ".zshrc" ".zshrc.core" ".zshrc.aliases" ".zshrc.functions" ".zprofile" )
for file in "${shell_files[@]}"; do
    if [ -f "$REPO_CONFIGS/$file" ]; then
        rm -f "$HOME/$file"
        cp "$REPO_CONFIGS/$file" "$HOME/"
        echo "  ✅ Installed $file"
    fi
done

# Wallpapers
if [ -d "$REPO_CONFIGS/images" ]; then
    mkdir -p "$HOME/.config/PolLand"
    rm -rf "$HOME/.config/PolLand/images"
    cp -r "$REPO_CONFIGS/images" "$HOME/.config/PolLand/"
    echo "  🖼️  Installed wallpapers"
fi

echo ""
echo "✅ Installation complete!"
echo "💡 Reload Hyprland with Super+Shift+R"
echo ""
echo "📝 Note: This is v1 - no user override support yet."
echo "   Your changes will be overwritten on the next update."
EOF
    
    chmod +x "$pkgdir/usr/lib/polland/sync-user-config.sh"
    
    # Install wrapper
    mkdir -p "$pkgdir/usr/bin"
    cat > "$pkgdir/usr/bin/polland-sync" << 'EOF'
#!/bin/bash
exec /usr/lib/polland/sync-user-config.sh "$@"
EOF
    chmod +x "$pkgdir/usr/bin/polland-sync"
}