-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
executable file
·69 lines (54 loc) · 1.52 KB
/
install.sh
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
#!/bin/bash
#####################################
# Icosium Conky installation script #
#####################################
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
INSTALL_FILES=(icosium.lua icosiumrc README.md launch-icosium.sh)
DESTINATION=~/.config/conky/icosium-conky
STARTUP_DIR=~/.config/autostart
LAUNCH_SCRIPT=$DESTINATION/launch-icosium.sh
# Install in ~/.config/conky directory
echo "You are about to install Icosium Conky."
echo "Any similar files in '$DESTINATION' will be overwritten."
echo -n "Do you want to proceed? [Y/n] "
read -r ANSWER
if [[ "$ANSWER" == [Yy] ]]; then
echo "Installing Icosium Conky..."
mkdir -p "$DESTINATION"
for i in "${INSTALL_FILES[@]}"; do
cp "$i" "$DESTINATION" > /dev/null 2>&1
done
echo "Successfuly Installed."
else
echo "Aborting..."
exit 0
fi
# Launch it at startup
echo -n "Do you want to launch Icosium Conky at startup ? [Y/n] "
read -r ANSWER2
if [[ "$ANSWER2" == [Yy] ]]; then
echo "creating startup file"
mkdir -p "$STARTUP_DIR"
cat >> $STARTUP_DIR/icosium-conky.desktop <<EOF
[Desktop Entry]
Categories=System;
Exec=cd "$DESTINATION" && conky -c "$DESTINATION/icosiumrc" &
Name=Icosium
Path="$DESTINATION"
StartupNotify=true
Terminal=false
Type=Application
EOF
else
echo "Abort launch at startup"
exit 0
fi
# Launch it now
echo -n "Do you want to launch it now ? [Y/n] "
read -r ANSWER3
if [[ "$ANSWER3" == [Yy] ]]; then
echo "launching Icosium conky"
bash "$LAUNCH_SCRIPT"
else
exit 0
fi