diff --git a/020_mutt-wizard.sh b/020_mutt-wizard.sh index 23771fc..6275ede 100755 --- a/020_mutt-wizard.sh +++ b/020_mutt-wizard.sh @@ -1,6 +1,28 @@ #!/usr/bin/bash -cd /var/tmp -apt-get install -y neomutt urlscan w3m w3m-img ripmime isync msmtp vdirsyncer pass mailsync libnotify-bin lynx urlview + + +# isync +# msmtp +# neomutt +# notmuch-runtime +# pass +# git +# abook (optional) – contact store and tab completion +# cronie (optional) – auto-sync mails - alt.: fcron +# dunst (optional) – enable desktop notifications about new mail +# fcron (optional) – auto-sync mails - alt.: cronie +# imagemagick (optional) – view images inside of the neomutt TUI +# libnotify (optional) – enable desktop notifications about new mail +# pam-gnupg (optional) – automatically unlock gpg keys at session login +# urlview (optional) – list URLs found in mails to open them in a browser +# w3m (optional) – view HTML email and images inside of the neomutt TUI +# elinks (optional) – view HTML email inside of the neomutt TUI +# links (optional) – view HTML email inside of the neomutt TUI +# lynx (optional) – view HTML email inside of the neomutt TUI + + +set -x +apt-get install -y git neomutt urlscan w3m w3m-img ripmime isync msmtp vdirsyncer pass mailsync libnotify-bin lynx urlview echo 'alias mutt="neomutt "' >> ~/.zsh_aliases.d/002_neomutt.zsh @@ -11,17 +33,85 @@ PRERELEASE=false # RELEASE=$(curl "https://api.github.com/repos/${PROJECT}/releases?per_page=5" | jq -r '.[0] | select( .prerelease = false ) |.tag_name') # VERSION=$(echo "${RELEASE}" | cut -c 2- | cut -f1 -d"-") VERSION=$( date +%Y-%m-%d_ )git -DOWNLOAD_DIR=/tmp + +BUILD_DIR=/var/tmp/build_mutt-wizard +mkdir -p ${BUILD_DIR} # make a containing directory mkdir -p /var/tmp/${BASE_REPO}-"${RELEASE}" cd /var/tmp/${BASE_REPO}-"${RELEASE}" || exit -cat > ./description-pak << EOF +cat > ${BUILD_DIR}/description-pak << EOF A system for automatically configuring mutt and isync with a simple interface and safe passwords EOF -cat > ./checkinstall_it.sh << 'EOF' +## Files and directories to be created: +# $HOME/usr/local/share/mutt-wizard/mutt-wizard.muttrc +# $HOME/usr/local/share/mutt-wizard/mutt-wizard-colors.muttrc +# $HOME/.config/mutt/muttrc +# $HOME/.config/mutt/colorschemes/colors-gruvbox-shuber-extended.muttrc +# $HOME/.config/mutt/colorschemes/colors-gruvbox-shuber.muttrc +# $HOME/.config/mutt/accounts/1-example_profile.muttrc + +cat > ${BUILD_DIR}/checkinstall_it.sh << 'EOF' + +echo "ENTERING CHECKINSTALL" + +BASE_URL='https://api.github.com/repos' +BASE_USER='LukeSmithxyz' +BASE_REPO='mutt-wizard' +LICENSE_PAGE_URL="${BASE_URL}/${BASE_USER}/${BASE_REPO}"/license +RELEASES_URL="${BASE_URL}/${BASE_USER}/${BASE_REPO}"/releases + +# CONTENT=$(curl -s ${RELEASES_URL}/latest) +# LATEST_URL=$(echo "${CONTENT}" | jq --raw-output '.assets[] | select(.browser_download_url | test("Linux-x86_64")) | .browser_download_url') + +echo "LATEST_URL: " "${LATEST_URL}" + +# RELEASE=$(echo "${CONTENT}" | jq --raw-output '.tag_name') + +# LICENSE_URL=$(curl "${LICENSE_PAGE_URL}" | jq --raw-output '.download_url') +# wget -c ${LICENSE_URL} + +VERSION=$( date +%Y-%m-%d_ )git +VERSION=1.0 +RELEASE=git + +# make a new temporary directory for this use +BASE_TMP_DIR=~/tmptmp/checkinstall_tmp +mkdir -p ${BASE_TMP_DIR} + +# do your work +checkinstall -y --fstrans \ + --pkgname=mutt-wizard \ + --pkgversion=${VERSION}\ + --pkgrelease=${RELEASE} \ + --pkgarch=amd64 \ + --pkggroup=admin \ + --pkglicense=LICENSE \ + --pkgsource=${LATEST_URL} \ + --maintainer=cyteen@ring-zero.co.uk \ + --requires=neomutt,isync,msmtp,pass \ + -D \ + bash ./install.sh +EOF + +cat > ./install.sh << 'FOE' + +BASE_URL='https://api.github.com/repos' +BASE_USER='LukeSmithxyz' +BASE_REPO='mutt-wizard' +# RELEASES_URL="${BASE_URL}/${BASE_USER}/${BASE_REPO}"/releases +# CONTENT=$(curl -s ${RELEASES_URL}/latest) +# LATEST_URL=$(echo "${CONTENT}" | jq --raw-output '.assets[] | select(.browser_download_url | test("Linux-x86_64")) | .browser_download_url') +LATEST_URL=https://github.com/LukeSmithxyz/mutt-wizard + +## Download and copy the latest version to /usr/local/bin and make executable +git clone ${LATEST_URL} /var/tmp/mutt-wizard +cd /var/tmp/mutt-wizard +make install + +## Create directories and configuration files # '$ mw add' and follow the prompts. MUTTWIZARDCONF="/usr/local/share/mutt-wizard" @@ -32,7 +122,7 @@ FONTS="${MUTTDIR}/fonts" mkdir -p ${COLORSCHEMES} mkdir -p ${fonts} -mkdir -p $ACCDIR +mkdir -p ${ACCDIR} git clone https://github.com/sheoak/neomutt-powerline-nerdfonts.git ${MUTTDIR}/powerline @@ -304,6 +394,7 @@ source accounts/1-cyteen42.muttrc source /usr/local/share/mutt-wizard/mutt-wizard.muttrc #source /usr/local/share/mutt-wizard/mutt-wizard-colors.muttrc +set editor = nvim set sort = threads set sort_aux = reverse-last-date-received color progress white red @@ -336,27 +427,35 @@ EOF -mkdir -p $ACCDIR/${PROFILE_NAME} - -cat > $ACCDIR/1-${PROFILE_NAME}.muttrc < -set folder = "/home/${USER_NAME}/.local/share/mail/mutt" -set header_cache = /home/${USER_NAME}/.cache/mutt-wizard/ -set message_cachedir = /home/${USER_NAME}/.cache/mutt-wizard/ -set mbox_type = Maildir -EOF - # auto-generated with mutt-wizard: 'mw add' and follow the instructions # mailboxes populated from the email account imap server so for a clean # account just put in the standard =Inbox =Drafts =Trash =Sent =Junk -PROFILE_NAME=cyteen42 -EMAIL=cyteen42@yahoo.co.uk -REAL_NAME="cyteen may" +PROFILE_NAME=example_profile +EMAIL=foobar@foo.bar +REAL_NAME="foo bar" + +mkdir -p $ACCDIR/${PROFILE_NAME} + +cat > $ACCDIR/README < $ACCDIR/1-${PROFILE_NAME}.muttrc < +#set folder = "/home/${USER_NAME}/.local/share/mail/mutt" +#set header_cache = /home/${USER_NAME}/.cache/mutt-wizard/ +#set message_cachedir = /home/${USER_NAME}/.cache/mutt-wizard/ +#set mbox_type = Maildir +#EOF mkdir -p $ACCDIR/${PROFILE_NAME} @@ -384,7 +483,7 @@ set spoolfile = "+Inbox" set record = "+Sent" set postponed = "+Drafts" set trash = "+Trash" -mailboxes "=Bulk\ Mail" "=eBay\ -\ won" "=eBay\ -\ dispatched" "=Archives.2013" "=2600hz\ Blog" "=devuan_list" "=Drafts" "=Inbox" "=aliexpress" "=Raspberry\ Pi" "=Archives.2014" "=paypal" "=greencycle\ taken" "=tutum" "=Junk" "=dinodirect" "=Archives.2017" "=eBay\ -\ confirmed" "=greencycle\ offered" "=diyaudio" "=Trash" "=greencycle\ wanted" "=artisan" "=Draft" "=Archives.2015" "=eBay" "=Archives" "=eBay\ -\ Ending" "=Sent" "=dealextreme" "=eBay\ -\ new\ items" "=Archive" "=Drafts.2013" +mailboxes "=Inbox =Drafts =Trash =Sent =Junk" macro index,pager gi "=Inbox" "go to inbox" # mw-autogenerated macro index,pager Mi ";=Inbox" "move mail to inbox" # mw-autogenerated macro index,pager Ci ";=Inbox" "copy mail to inbox" # mw-autogenerated @@ -405,5 +504,7 @@ macro index,pager Ma ";=Archives.2013" "move mail to archiv macro index,pager Ca ";=Archives.2013" "copy mail to archive" # mw-autogenerated EOF +FOE +bash ./checkinstall_it.sh #mbsync ${PROFILE_NAME}