diff --git a/etc/categoryedit b/etc/categoryedit index 408c24e..4814e44 100755 --- a/etc/categoryedit +++ b/etc/categoryedit @@ -21,15 +21,20 @@ if [ ! -z "$1" ];then echo "The $1 app is currently in the $(echo "$structure" | grep "$1"'|' | awk -F '|' '{print $2}') category." fi - if ! echo "$structure" | grep -q '|'"$2" ;then - echo "The $2 category did not exist previously." + #check if $2 is --delete + if [ "$2" == '--delete' ];then + output="$(echo "$structure" | grep -v "$1"'|')" + else + if ! echo "$structure" | grep -q '|'"$2" ;then + echo "The $2 category did not exist previously." + fi + + echo "Putting the $1 app in the $2 category..." + + #replace any mention of the $1 app with the new line at the end of file + output="$(echo -e "$(echo "$structure" | grep -v "$1"'|')\n$1|$2" | sort)" fi - echo "Putting the $1 app in the $2 category..." - - #replace any mention of the $1 app with the new line at the end of file - output="$(echo -e "$(echo "$structure" | grep -v "$1"'|')\n$1|$2" | sort)" - #only change the structure file if something was really changed if [ "$output" != "$(cat "${DIRECTORY}/data/categories/structure")" ];then echo "$output" > "${DIRECTORY}/data/categories/structure" diff --git a/gui b/gui index c3a1aba..1f29277 100755 --- a/gui +++ b/gui @@ -76,7 +76,7 @@ runonce " '${DIRECTORY}/etc/categoryedit' 'Snapdrop' Tools >/dev/null '${DIRECTORY}/etc/categoryedit' 'Node.js' Tools >/dev/null" - +#re-run install script on twistos lite to show select pre-hidden apps runonce " if [ -f /usr/local/bin/twistver ] && [[ "\$"(twistver) != 'Twister OS version'* ]] ;then '${DIRECTORY}/install' diff --git a/install b/install index 14083e4..ca73cf0 100755 --- a/install +++ b/install @@ -163,14 +163,14 @@ Mac OS Theme" IFS="$PREIFS" #unhide some apps on twisteros lite that were hidden. - #This moves these apps to the '' category, which will be reset next time pi-apps launches - "${DIRECTORY}/etc/categoryedit" CommanderPi >/dev/null - "${DIRECTORY}/etc/categoryedit" Discord >/dev/null - "${DIRECTORY}/etc/categoryedit" piKiss >/dev/null - "${DIRECTORY}/etc/categoryedit" Scrcpy >/dev/null - "${DIRECTORY}/etc/categoryedit" Steam >/dev/null - "${DIRECTORY}/etc/categoryedit" 'Chromium Widevine' >/dev/null - "${DIRECTORY}/etc/categoryedit" 'Back to Chromium v78' >/dev/null + #This removes certain apps completely from the category file. Effectively resets them to online default. + "${DIRECTORY}/etc/categoryedit" CommanderPi --delete >/dev/null + "${DIRECTORY}/etc/categoryedit" Discord --delete >/dev/null + "${DIRECTORY}/etc/categoryedit" piKiss --delete >/dev/null + "${DIRECTORY}/etc/categoryedit" Scrcpy --delete >/dev/null + "${DIRECTORY}/etc/categoryedit" Steam --delete >/dev/null + "${DIRECTORY}/etc/categoryedit" 'Chromium Widevine' --delete >/dev/null + "${DIRECTORY}/etc/categoryedit" 'Back to Chromium v78' --delete >/dev/null echo "Finished hiding apps on TwisterOS."