summaryrefslogtreecommitdiffstats
path: root/bin/mailto_handler
blob: b85d0e4f06160edadb223865ab427290b24e8d39 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/sh

# 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" -- "$@"