-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall
executable file
·84 lines (63 loc) · 2.46 KB
/
install
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
#!/bin/bash
CONFIG_SRC_DIR=$HOME/Documents/configuration/src
WORKSTATION_CONFIG_DIR=$HOME/Documents/configuration/workstation
MAIL_RECIPE_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
shef apt alot
shef brew isync
shef apt msmtp
shef apt notmuch
if [ ! -d $HOME/mail/work ]; then
mkdir -p $HOME/mail/work
fi
# TODO prompt user to create the mail-recipe file
source $WORKSTATION_CONFIG_DIR/mail-recipe
if [ ! -d $CONFIG_SRC_DIR/.msmtp ]; then
git clone $MSMTP_REPO_URL $CONFIG_SRC_DIR/.msmtp
ln -s -f $CONFIG_SRC_DIR/.msmtp/msmtprc $HOME/.msmtprc
fi
cd $CONFIG_SRC_DIR/.msmtp
git pull
cd -
if [ ! -d $CONFIG_SRC_DIR/.mbsync ]; then
git clone $MBSYNC_REPO_URL $CONFIG_SRC_DIR/.mbsync
ln -s -f $CONFIG_SRC_DIR/.mbsync/mbsyncrc $HOME/.mbsyncrc
fi
cd $CONFIG_SRC_DIR/.mbsync
git pull
cd -
if [ ! -d $CONFIG_SRC_DIR/.notmuch ]; then
git clone $NOTMUCH_REPO_URL $CONFIG_SRC_DIR/.notmuch
ln -s -f $CONFIG_SRC_DIR/.notmuch/notmuch-config $HOME/.notmuch-config
fi
cd $CONFIG_SRC_DIR/.notmuch
git pull
cd -
if [ ! -d $CONFIG_SRC_DIR/.alot ]; then
git clone $ALOT_REPO_URL $CONFIG_SRC_DIR/.alot
mkdir -p $HOME/.config/alot
fi
cd $CONFIG_SRC_DIR/.alot
git pull
ln -s -f $CONFIG_SRC_DIR/.alot/config $HOME/.config/alot/config
ln -s -f $CONFIG_SRC_DIR/.alot/hooks.py $HOME/.config/alot/hooks.py
ln -s -f $CONFIG_SRC_DIR/.alot/mailcap $HOME/.mailcap
cd -
FIND_MAILTO=$(grep -nri "mailto" $HOME/.local/share/applications/mimeapps.list)
if [ $? -eq 1 ]; then
echo "x-scheme-handler/mailto=alot.desktop" >> $HOME/.local/share/applications/mimeapps.list
fi
sudo cp --update $MAIL_RECIPE_DIR/files/sync-mail /usr/local/bin
sudo chmod +x /usr/local/bin/sync-mail
sudo cp --update $MAIL_RECIPE_DIR/files/zmail /usr/local/bin
sudo chmod +x /usr/local/bin/zmail
cp --update $MAIL_RECIPE_DIR/files/zmail.desktop $HOME/.local/share/applications
cp --update $MAIL_RECIPE_DIR/files/zmail.png $HOME/.local/share/icons
if [ ! -d $HOME/.local/configuration/mail ]; then
mkdir -p $HOME/.local/configuration/mail
fi
cp --update $MAIL_RECIPE_DIR/files/tmux.conf $HOME/.local/configuration/mail
cp --update $MAIL_RECIPE_DIR/files/zmail.yml $HOME/.config/tmuxinator
(crontab -l ; echo "*/5 * * * * sync-mail") 2>&1 | grep -v "no crontab" | sort | uniq | crontab -
sudo cp --update $MAIL_RECIPE_DIR/files/prompt-for-gpg-key /usr/local/bin
cp --update $MAIL_RECIPE_DIR/files/prompt-for-gpg-key.desktop $HOME/.local/share/applications/prompt-for-gpg-key.desktop
pip3 install urlscan