Having a default account setter is handy, instead of having to mod the creds file constantly.

This commit is contained in:
Zergling_man 2023-11-26 17:45:42 +11:00
parent 261f125761
commit b3185b2d25
2 changed files with 7 additions and 7 deletions

View File

@ -2,7 +2,7 @@
#Well, it seems to work now.
pkgname=clemmy
pkgver=0.1.4
pkgver=0.1.6
pkgrel=1
pkgdesc='A pure bash client for lemmy, with multiaccount support.'
arch=('any')
@ -15,7 +15,7 @@ sha256sums=('SKIP') #Don't know how to use this on a repo.
package() {
cd ${pkgname}
install -d ${pkgdir}/usr/bin ${pkgdir}/opt/clemmy
rm PKGBUILD README.txt
rm README.txt
cp -r . ${pkgdir}/opt/clemmy
ln -s /opt/clemmy/clemmy.sh ${pkgdir}/usr/bin/clemmy
chmod +x ${pkgdir}/opt/clemmy/clemmy.sh

View File

@ -11,6 +11,8 @@ if [ ! -f ~/.config/clemmy/accounts.csv ]; then
exit
fi
touch ~/.config/clemmy/default_account
accsr=$(cat ~/.config/clemmy/accounts.csv)
i=0
for line in ${accsr[*]}; do
@ -18,9 +20,7 @@ for line in ${accsr[*]}; do
i=$((i+1))
done
select_account()
{
IFS=, read INSTANCE TOKE INSEC <<< "${accs[$1]}"
}
select_account(){ IFS=, read INSTANCE TOKE INSEC <<< "${accs[$1]}"; }
defaultacc(){ echo -n $1 > ~/.config/clemmy/default_account; }
select_account 0
select_account $(cat ~/.config/clemmy/default_account)