mfeed profile changer.

This commit is contained in:
CronyAkatsuki 2023-12-10 18:54:14 +01:00
parent dd9ff5bc26
commit 024b5696ab

15
mprofile Executable file
View File

@ -0,0 +1,15 @@
#!/bin/sh
profiles=$(find "$HOME"/.config/mblaze -type f -exec basename "{}" \;)
currentMaildir=$(grep "^Maildir:" "$HOME"/.mblaze/profile | cut -d: -f 2 | sed 's/ //g')
[ -z "$1" ] && basename "$(grep -w "$currentMaildir" -l -R "$HOME"/.config/mblaze)" && exit 0
[ "$1" = "-l" ] && printf '%s\n' "$profiles" && exit 0
profile="$1"
if printf '%s\n' "$profiles" | grep -qw "$profile"; then
cp "$HOME"/.config/mblaze/"$profile" "$HOME"/.mblaze/profile
else
printf '%s\n' "This profile doesn't exist"
fi