mfeed profile changer.
This commit is contained in:
parent
dd9ff5bc26
commit
024b5696ab
15
mprofile
Executable file
15
mprofile
Executable 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
|
Loading…
Reference in New Issue
Block a user