summarylogtreecommitdiffstats
path: root/papirus-plasma-theme.install
blob: 5aaebe46789a8a27e8ee59bfa7f59b4c1acf1b92 (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
plasma-cache-refresh() {
    _l="/etc/login.defs"
    _p="/etc/passwd"

    ## get mini UID limit ##
    l=$(grep "^UID_MIN" $_l)

    ## get max UID limit ##
    l1=$(grep "^UID_MAX" $_l)

    ## use awk to print if UID >= $MIN and UID <= $MAX and shell is not /sbin/nologin   ##
    users=$(awk -F':' -v "min=${l##UID_MIN}" -v "max=${l1##UID_MAX}" '{ if ( $3 >= min && $3 <= max  && $7 != "/sbin/nologin" ) print $0 }' "$_p" | cut -d: -f1)
    for u in $users; do
        rm -rf /home/$u/.cache/plasma* &> /dev/null
    done
    echo "Plasma cache files were purged."
    echo "Reboot for regenerate plasma cache files."
}

papirus-dark-note() {
    echo "WARNING: Papirus Dark was removed."
    echo "If You using Papirus Dark variant, switch to arc-dark-suite-git"
}

pre_install() {
    echo "WARNING: This project was discontinued upstream."
    echo "Future versions will not be available, keep this in consideration."
}

post_install() {
    plasma-cache-refresh
    papirus-dark-note
}

post_upgrade() {
    plasma-cache-refresh
    papirus-dark-note
}