summarylogtreecommitdiffstats
path: root/armory.install
blob: 28db4d07d84cb4d5603f58a84151650c470cdbf3 (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
ARMORY_IMG_DIR="/usr/share/armory/img"

# Colored makepkg-like functions
msg_blue() {
    printf "${blue}==>${bold} $1${all_off}\n"
}

note() {
    printf "${blue}==>${yellow} NOTE:${bold} $1${all_off}\n"
}

all_off="$(tput sgr0)"
bold="${all_off}$(tput bold)"
blue="${bold}$(tput setaf 4)"
yellow="${bold}$(tput setaf 3)"

post_install() {
    msg_blue "Installing Armory icons ..."
    xdg-icon-resource install --novendor --context apps --size 64 "${ARMORY_IMG_DIR}/armory_icon_64x64.png" armoryicon
    xdg-icon-resource install --novendor --context apps --size 64 "${ARMORY_IMG_DIR}/armory_icon_64x64.png" armoryofflineicon
    xdg-icon-resource install --novendor --context apps --size 64 "${ARMORY_IMG_DIR}/armory_icon_green_64x64.png" armorytestneticon
}

post_upgrade() {
    if [ -d "/opt/armory-goatpig-git" ]; then
    msg_blue "Install location has moved, removing old Armory directory at /opt/armory-goatpig-git ..."
    rm -rdf "/opt/armory-goatpig-git"
    fi
}

pre_remove() {
    msg_blue "Removing Armory icons ..."
    xdg-icon-resource uninstall --size 64 armoryicon
    xdg-icon-resource uninstall --size 64 armorytestneticon
    xdg-icon-resource uninstall --size 64 armoryofflineicon
}