src/install.sh 1.3 K raw
1
#!/bin/sh
2
# Install Darkmatter into ~/.themes.
3
#
4
# Copies only what the theme actually ships: the two GTK stylesheets, the
5
# xfwm4 decorations and their hidpi variants, the shared raster assets, and
6
# index.theme. Build sources stay behind.
7
#
8
# Run from the theme root:  sh src/install.sh
9
10
set -e
11
[ -f index.theme ] || { echo "run me from the theme root" >&2; exit 1; }
12
13
dest="${1:-$HOME/.themes}"
14
name=Darkmatter
15
16
install_one() {   # install_one <theme name> <xfwm4 source dir>
17
    target="$dest/$1"
18
    rm -rf "$target"
19
    mkdir -p "$target/xfwm4"
20
    cp index.theme "$target/index.theme"
21
    [ "$1" = "$name" ] || sed -i "s/^Name=.*/Name=$1/" "$target/index.theme"
22
    mkdir -p "$target/assets"
23
    # only the rasters: the SVGs beside them are build sources GTK never reads
24
    find assets -maxdepth 1 -name '*.png' -exec cp {} "$target/assets/" \;
25
    for v in gtk-3.0 gtk-4.0; do
26
        mkdir -p "$target/$v"
27
        cp "$v/gtk.css" "$v/gtk-dark.css" "$target/$v/"
28
        [ -f "$v/thumbnail.png" ] && cp "$v/thumbnail.png" "$target/$v/"
29
    done
30
    find "$2" -maxdepth 1 -type f -exec cp {} "$target/xfwm4/" \;
31
    echo "  $target"
32
}
33
34
install_one "$name"        xfwm4
35
install_one "$name-hdpi"   xfwm4/Darkmatter-hdpi/xfwm4
36
install_one "$name-xhdpi"  xfwm4/Darkmatter-xhdpi/xfwm4