From 7419b9fc45ba291d5d10a9f5bea3fa5d33dfedc0 Mon Sep 17 00:00:00 2001 From: Yigit Sever Date: Wed, 16 Sep 2020 15:22:27 +0300 Subject: move bin to .local/bin --- .local/bin/mailto_handler | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100755 .local/bin/mailto_handler (limited to '.local/bin/mailto_handler') diff --git a/.local/bin/mailto_handler b/.local/bin/mailto_handler new file mode 100755 index 0000000..b85d0e4 --- /dev/null +++ b/.local/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