From 3b9d3eb84b53bc9d7578730707c0a724027cddb0 Mon Sep 17 00:00:00 2001 From: Yigit Sever Date: Tue, 23 Jun 2020 01:18:24 +0300 Subject: Tracking mailto_handler This should be pretty modular and work across multiple pcs --- bin/mailto_handler | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100755 bin/mailto_handler (limited to 'bin/mailto_handler') 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 @@ +#!/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" -- "$@" -- cgit v1.2.3-70-g09d2