12345678910111213141516171819202122232425262728293031323334 |
- #!/usr/bin/env bash
- # THIS SCRIPT IS NEEDED TO GENERATE A JSON FILE OF ALL APPLICATIONS WITH EASE
- cd $(xdg-user-dir DESKTOP)
- AMREPO="https://raw.githubusercontent.com/ivan-hc/AM-application-manager/main"
- arch="x86_64"
- echo "" >> args
- wget -q $AMREPO/programs/$arch-apps && echo -e "$(cat ./$arch-apps | awk -v FS="(◆ | : )" '{print $2}')" >> args
- echo STOP >> args
- ARGS=$(sed '1d' ./args)
- echo "[" >> apps.json
- # THIS IS THE WORKFLOW
- for arg in $ARGS; do
- for var in $arg; do
- if [ $arg == STOP ]; then
- break
- else
- case $arg in
- am) ;;
- appman) ;;
- *) for var in $arg;
- do
- description=$(cat $arch-apps | grep "◆ $arg :" | sed 's/"//g' | sed 's/^.*: //')
- echo -e ' {\n "packageName": "'$arg'",\n "description": "'$description'..",\n "icon": "https://portable-linux-apps.github.io/icons/'$arg'.png"\n },' >> apps.json
- sleep 0.005
- done;;
- esac
- fi
- done
- done
- sed -i '$s/,$//' apps.json
- echo -e "]" >> apps.json
- rm ./args ./$arch-apps
|