From 024b5696ab4ba819071f9fe4a4145e7cdf9c2670 Mon Sep 17 00:00:00 2001 From: CronyAkatsuki Date: Sun, 10 Dec 2023 18:54:14 +0100 Subject: [PATCH] mfeed profile changer. --- mprofile | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100755 mprofile diff --git a/mprofile b/mprofile new file mode 100755 index 0000000..ada5f85 --- /dev/null +++ b/mprofile @@ -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