-
Notifications
You must be signed in to change notification settings - Fork 3
/
install-taskcoach
59 lines (50 loc) · 2.2 KB
/
install-taskcoach
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
# install-taskcoach
# Useful - Install task manager – TaskCoach (using AppImage)
# Install powerful task manager TaskCoach (using AppImage)
echo -e "Running: Useful - Install task manager – TaskCoach (using AppImage) - ./scripts/install-taskcoach"
TASKCOACH_VERSION="1.4.6"
APPIMAGES_PATH="/home/$USER/.local/bin"
## Create directory for AppImage images
mkdir -p $APPIMAGES_PATH &&
## Add PATH for AppImage entries
echo -e "# Setup AppImage
# ---------
if [[ ! \"\$PATH\" == *$APPIMAGES_PATH* ]]; then
export PATH=\"\${PATH:+\${PATH}:}$APPIMAGES_PATH\"
fi" > /home/$USER/.appimage.bash &&
## AppImage entry to .bashrc (if not exist)
if ! grep -Fxq "[ -f ~/.appimage.bash ] && source ~/.appimage.bash" /home/$USER/.bashrc
then
echo "[ -f ~/.appimage.bash ] && source ~/.appimage.bash" >> /home/$USER/.bashrc
source /home/$USER/.bashrc
fi
## Download AppImage
wget -P /tmp https://sourceforge.net/projects/taskcoach/files/taskcoach/Release-$TASKCOACH_VERSION/TaskCoach-$TASKCOACH_VERSION-x86_64.AppImage &&
mv /tmp/TaskCoach-$TASKCOACH_VERSION-x86_64.AppImage $APPIMAGES_PATH &&
chmod +x $APPIMAGES_PATH/TaskCoach-$TASKCOACH_VERSION-x86_64.AppImage &&
## Download icon
wget -O /tmp/taskcoach.ico https://sourceforge.net/p/taskcoach/repo/ci/default/tree/taskcoach/icons.in/taskcoach.ico?format=raw &&
mv /tmp/taskcoach.ico $APPIMAGES_PATH/ &&
## Add firejail configuration (if installed and user is able to use firejail) for AppImage
if [[ $(dpkg-query -W -f='${Status}' firejail 2>/dev/null | grep -c "ok installed") -eq 1 ]] && [[ `cat /etc/firejail/firejail.users` == *$USER* ]];
then
APPIMAGE_EXEC="firejail --appimage $APPIMAGES_PATH/TaskCoach-$TASKCOACH_VERSION-x86_64.AppImage"
else
APPIMAGE_EXEC="$APPIMAGES_PATH/TaskCoach-$TASKCOACH_VERSION-x86_64.AppImage"
fi
## Integrate TaskCoach AppImage with desktop
mkdir -p /home/$USER/.local/share/applications &&
echo -e "[Desktop Entry]\n\
Type=Application\n\
Name=Task Coach\n\
Icon=$APPIMAGES_PATH/taskcoach.ico\n\
Exec=$APPIMAGE_EXEC\n\
Terminal=false\n\
Comment=Task Coach Your Friendly Task Manager" | tee /home/$USER/.local/share/applications/taskcoach.desktop > /dev/null
if [ $? -eq 0 ]; then
echo -e "\\nOK\\n"
exit 0
else
echo -e "\\nFAIL\\n"
exit 1
fi