summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: f8db390425ff467c949863938fc1f3bcb62797d4 (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
# Maintainer: gigas002 <gigas002@pm.me>
# Maintainer: dr460nf1r3 <aur@dr460nf1r3.org>

pkgname=plasma5-themes-sweet-full-git
_pkgname=sweet
pkgver=r368.cf72cb4
pkgrel=4
pkgdesc="Sweet KDE Plasma theme"
arch=('x86_64')
url="https://github.com/EliverLara/$_pkgname"
license=('GPL3')
makedepends=('git' 'inkscape' 'optipng' 'xorg-xcursorgen')
depends=('plasma5-themes-sweet-kde-git'
         'kvantum'
         'candy-icons-git')
optdepends=('ttf-roboto: primary font face defined (GTK theme)'
            'ttf-ubuntu-font-family: secondary font face defined (GTK theme)'
            'cantarell-fonts: tertiary font face defined (GTK theme)'
            'sweet-folders-icons-git: sweet folder icons')
provides=("sweet-theme")
conflicts=('sweet-kde' 'sweet-kde-git' 'sweet-gtk-theme' 'sweet-theme-git'
           'sweet-cursor-theme-git' 'sweet-cursor-theme' 'sweet-cursors-theme'
           'kvantum-theme-sweet-git' 'sweet-kvantum-theme-git' 'sweet-gtk-theme-dark'
           'plasma5-theme-sweet-git' 'sweet-theme-full-git')
options=('!strip')
patch="cursors.patch"
source=("git+$url.git#branch=nova")
sha256sums=('SKIP')

pkgver() {
    cd $srcdir/$_pkgname
    printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

 prepare() {
    cd $srcdir/$_pkgname
    patch -p1 -i $startdir/$patch
 }

build() {
    cd $srcdir/$_pkgname

    export THEME_FONT_FACE=${THEME_FONT_FACE:-Roboto}
    export THEME_FONT_SIZE=${THEME_FONT_SIZE:-10}

    msg2 "To customize the font and size for gnome-shell, build this package"
    msg2 "with the variables below set to the desired font family and size"
    msg2 "- THEME_FONT_FACE (default font family is Roboto)"
    msg2 "- THEME_FONT_SIZE (default font point size is 10)"

    msg2 "Rendering assets, please wait"
    pushd gtk-2.0
    while read $line; do echo -n "."; done < \
        <(./render-assets.sh 2>/dev/null); echo
    popd

    pushd src
    while read $line; do echo -n "."; done < \
        <(./render-gtk3-assets.py 2>/dev/null; \
        ./render-gtk3-assets-hidpi.py 2>/dev/null; \
        ./render-wm-assets-hidpi.py 2>/dev/null; \
        ./render-wm-assets.py 2>/dev/null); echo
    popd
    msg2 "Done!"

    msg2 "Setting gnome-shell font face to $THEME_FONT_FACE"
    msg2 "Setting gnome-shell font size to $THEME_FONT_SIZE"

    if [ "$THEME_FONT_FACE" != "Roboto" ]; then
        sed -i -re "s/font-family: (.*);/font-family: $THEME_FONT_FACE, \1;/" \
            "$srcdir/$_pkgname/gnome-shell/gnome-shell.css"
    fi

    if [ $THEME_FONT_SIZE != "10" ]; then
        sed -i -re "s/font-size: (.*);/font-size: $THEME_FONT_SIZEpt;/" \
            "$srcdir/$_pkgname/gnome-shell/gnome-shell.css"
    fi

    cd $srcdir/$_pkgname/kde/cursors

    # # update xcursors
    chmod +x build.sh
    ./build.sh
}

package() {
    cd $srcdir/$_pkgname/kde
    mkdir -p $pkgdir/usr/share
    
    # Workaround: https://github.com/EliverLara/Sweet/issues/78 + fix for splashscreen
    mkdir -p aurorae/themes
    mv -f aurorae/Sweet-Dark aurorae/themes/Sweet-Dark
    mv -f aurorae/Sweet-Dark-transparent aurorae/themes/Sweet-Dark-transparent
    rm aurorae/.shade.svg
    mv -f colorschemes color-schemes
    mkdir -p plasma/look-and-feel
    mv -f look-and-feel plasma/look-and-feel/Sweet
    mv -f sddm sddm-Sweet
    mkdir -p sddm/themes
    mv -f sddm-Sweet sddm/themes/Sweet

    # KDE theme
    mv -f aurorae $pkgdir/usr/share
    mv -f color-schemes $pkgdir/usr/share
    mv -f konsole $pkgdir/usr/share
    mv -f plasma $pkgdir/usr/share
    mv -f sddm $pkgdir/usr/share

    # cursors
    mkdir -p $pkgdir/usr/share/icons
    mv -f cursors/Sweet-cursors $pkgdir/usr/share/icons

    # kvantum
    mv -f Kvantum $pkgdir/usr/share

    # GTK
    cd $srcdir/$_pkgname
    mkdir -p $pkgdir/usr/share/themes/$_pkgname
    mv -f assets $pkgdir/usr/share/themes/$_pkgname/
    mv -f cinnamon $pkgdir/usr/share/themes/$_pkgname/
    mv -f gnome-shell $pkgdir/usr/share/themes/$_pkgname/
    mv -f gtk-2.0 $pkgdir/usr/share/themes/$_pkgname/
    mv -f gtk-3.0 $pkgdir/usr/share/themes/$_pkgname/
    mv -f gtk-4.0 $pkgdir/usr/share/themes/$_pkgname/
    mv -f metacity-1 $pkgdir/usr/share/themes/$_pkgname/
    mv -f xfwm4 $pkgdir/usr/share/themes/$_pkgname/
    mv -f index.theme $pkgdir/usr/share/themes/$_pkgname/
}