This repository has been archived by the owner on Nov 20, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild
118 lines (104 loc) · 3.88 KB
/
build
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
#!/bin/bash
# ALTER_desktop-0.0.5-alpha - An Unofficial Desktop App for Linux-x64 wrapped with 'nativefier'
## resources/scrollbar.css injection script from https://gist.github.com/febritecno/82ec55602ccd2cbb08ef69fa4c863d46/
## Loading Vairables
echo
source resources/variables
echo
echo
echo "Detecting Operating System..."
if [[ "$OSTYPE" =~ ^darwin ]]; then
## Not yet supported/tested
echo "Not yet supported on macOS"
exit
fi
if [[ "$OSTYPE" =~ ^linux-gnu ]]; then
echo "Linux detected - continuing install"
## Creates ALTER.desktop to local applications folder, allowing it to be discoverable in your applications list
echo
if ! $IT0 >/dev/null; then
echo -e "${RED}No .desktop file detected. Creating...${ENDCOLOR}"
mkdir $HOME/.local/share/applications
else
$RM $HOME/.local/share/applications/ALTER.desktop
echo -e "${BOLDGREEN}Removed old .desktop file and created new .desktop file.${ENDCOLOR}"
fi
echo -e "${BOLDGREEN}Creating ALTER.desktop in $HOME/.local/share/applications/${ENDCOLOR}"
cat <<EOF >> ~/.local/share/applications/ALTER.desktop
[Desktop Entry]
Encoding=UTF-8
Version=1.0
Type=Application
Terminal=false
Categories=Network;Email;Chat;InstantMessaging;FileTransfer;TrayIcon
Exec=$HOME/.local/share/ALTER_desktop/ALTER_desktop
Name=ALTER
Icon=$HOME/.local/share/icons/alter.png
EOF
echo
cat $HOME/.local/share/applications/ALTER.desktop
## Copies alter.png to your root icons folder to use the ALTER logo as the ALTER_dekstop icon
$DV2
echo
echo -e "${BOLDGREEN}Creating ALTER_desktop${ENDCOLOR}"
echo -e "${BOLDGREEN}If it doesn't exsit, will create .local/share${ENDCOLOR}"
mkdir ~/.local/share
echo -e "${BOLDGREEN}If it doesn't exsit, will create .local/share/icons${ENDCOLOR}"
mkdir ~/.local/share/icons
echo -e "${BOLDGREEN}Moving alter.png to icons folder${ENDCOLOR}"
$CP resources/alter.png $HOME/.local/share/icons/alter.png
echo
$DV2
## Installs a local version of Nativefier to interact with resources/nativefier.json
echo -e "${BOLDGREEN}Installing local Nativefier module in current folder to build ALTER_desktop...${ENDCOLOR}"
npm install nativefier
echo -e "${BOLDGREEN}Running ALTER_desktop.js${ENDCOLOR}"
node resources/ALTER_desktop.js
echo -e "${BOLDGREEN}Built ALTER_desktop succesfully. Removing local Nativefier module...${ENDCOLOR}"
npm uninstall nativefier
echo
echo
echo
$DV2
## Move ALTER-linux-x64 to ALTER_desktop
echo
echo -e "${BOLDGREEN}Moving ALTER_desktop-linux-x64 to ALTER_desktop${ENDCOLOR}"
$MV ALTER_desktop-linux-x64 ALTER_desktop
echo
## Copying ALTER_desktop to $HOME/.local/ALTER_desktop
echo -e "${BOLDGREEN}Copying ALTER to $HOME/.local/share/ALTER_desktop${ENDCOLOR}"
$CP -r ALTER_desktop $HOME/.local/share/
$RM -rf ALTER_desktop
echo
## Checks to make sure installing ALTER_desktop was a success
if hash $RD1 2>/dev/null; then
echo -e "${RED}WARNING ALTER_desktop not on system${ENDCOLOR}"
echo -e "${CYAN}Please check your settings and environment${ENDCOLOR}"
exit
$DV2
else
echo
echo
echo
echo
echo -e "${GREEN}SERACHING FOR ALTER_desktop.......${ENDCOLOR}"
echo
echo -e "${GREEN}Successfully built ALTER_desktop. Nice!${ENDCOLOR}"
echo
echo
echo -e "${GREY}Locate ALTER_desktop in your applications list or run $HOME/.local/share/ALTER_desktop/ALTER_desktop${ENDCOLOR}"
echo
fi
$DV2
echo
echo -e "${YELLOW}$MSG1${ENDCOLOR}"
echo
echo -e "${YELLOW}$MSG2${ENDCOLOR}" "${GREY}$EMAIL1${ENDCOLOR}" or "${GREY}$EMAIL2${ENDCOLOR}"
echo
echo -e "${YELLOW}$MSG3${ENDCOLOR}" "${GREY}$ALTER${ENDCOLOR}"
echo
echo -e "${GREY}$URLS${ENDCOLOR}"
echo
echo
echo -e "${BOLDRED}$DIVIDER${ENDCOLOR}"
fi