#!/bin/sh set -e # we can now exit out from rofi, easily # rofi available mail accounts ACCOUNTSDIR=$HOME/.config/mutt/accounts choices='' first='0' for account in "${ACCOUNTSDIR}"/*.muttrc; do BASENAME=$(basename -- "${account}") pick="${BASENAME%.muttrc}" if [ $first -eq '0' ]; then choices="${pick}" first='1' else choices="${choices}\n${pick}" fi done picked=$(printf "${choices}" | rofi -dmenu) exec kitty -e neomutt -F "$HOME/.config/mutt/muttrc" -e "source /home/yigit/.config/mutt/accounts/${picked}.muttrc" -- "$@"