diff options
author | Yigit Sever | 2020-06-23 01:18:24 +0300 |
---|---|---|
committer | Yigit Sever | 2020-06-23 01:18:24 +0300 |
commit | 3b9d3eb84b53bc9d7578730707c0a724027cddb0 (patch) | |
tree | 6a59316630ee1f6c3175b52d2842b56752cc52c9 /bin | |
parent | 7fb32f0c99659048ba31856ccb7e7a3fb5ef08a8 (diff) | |
download | dotfiles-3b9d3eb84b53bc9d7578730707c0a724027cddb0.tar.gz dotfiles-3b9d3eb84b53bc9d7578730707c0a724027cddb0.tar.bz2 dotfiles-3b9d3eb84b53bc9d7578730707c0a724027cddb0.zip |
Tracking mailto_handler
This should be pretty modular and work across multiple pcs
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/mailto_handler | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/bin/mailto_handler b/bin/mailto_handler new file mode 100755 index 0000000..b85d0e4 --- /dev/null +++ b/bin/mailto_handler | |||
@@ -0,0 +1,24 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | # rofi available mail accounts | ||
4 | |||
5 | ACCOUNTSDIR=$HOME/.config/mutt/accounts | ||
6 | |||
7 | choices='' | ||
8 | first='0' | ||
9 | |||
10 | for account in "${ACCOUNTSDIR}"/*.muttrc; do | ||
11 | BASENAME=$(basename -- "${account}") | ||
12 | pick="${BASENAME%.muttrc}" | ||
13 | if [ $first -eq '0' ]; then | ||
14 | choices="${pick}" | ||
15 | first='1' | ||
16 | else | ||
17 | choices="${choices}\n${pick}" | ||
18 | fi | ||
19 | |||
20 | done | ||
21 | |||
22 | picked=$(printf "${choices}" | rofi -dmenu) | ||
23 | |||
24 | exec kitty -e neomutt -F "$HOME/.config/mutt/muttrc" -e "source /home/yigit/.config/mutt/accounts/${picked}.muttrc" -- "$@" | ||