From b3185b2d25b146b13b9c2a779297522c7ae1f77e Mon Sep 17 00:00:00 2001 From: Zergling_man Date: Sun, 26 Nov 2023 17:45:42 +1100 Subject: [PATCH] Having a default account setter is handy, instead of having to mod the creds file constantly. --- PKGBUILD | 4 ++-- creds.sh | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/PKGBUILD b/PKGBUILD index 98d9bb1..68df20f 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -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 diff --git a/creds.sh b/creds.sh index aca1bbd..f3f2e57 100644 --- a/creds.sh +++ b/creds.sh @@ -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 \ No newline at end of file +select_account $(cat ~/.config/clemmy/default_account)