Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"AM" 9.4.4 - Add options "hide" and "unhide" #1347

Merged
merged 4 commits into from
Feb 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 42 additions & 3 deletions APP-MANAGER
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

AMVERSION="9.4.3"
AMVERSION="9.4.4"

# Determine main repository and branch
AMREPO="https://raw.githubusercontent.com/ivan-hc/AM/main"
Expand Down Expand Up @@ -481,9 +481,9 @@ export awk_name="1" awk_description="2" awk_site="3" awk_dl="4" awk_ver="5" # Nu
################################################################################

# COMPLETION LIST
available_options="about add apikey backup clean config disable downgrade download enable extra files home icons info \
available_options="about add apikey backup clean config disable downgrade download enable extra files hide home icons info \
install install-appimage launcher list lock neodb newrepo nolibfuse off on overwrite purge query remove sandbox \
select sync template test unlock update --all --appimages --apps --byname --config --convert --debug \
select sync template test unhide unlock update --all --appimages --apps --byname --config --convert --debug \
--devmode-disable --devmode-enable --disable-notifications --enable-notifications --force-latest --home --icons \
-ias --launcher --less --pkg --rollback --disable-sandbox --sandbox --system --user $third_party_flags"

Expand Down Expand Up @@ -801,6 +801,29 @@ _use_clean() {
_clean_old_modules
}

################################################################################
# HIDE/UNHIDE
################################################################################

_use_hide_unhide() {
entries="$(echo "$@" | cut -f2- -d ' ')"
if [ "$1" = hide ]; then
for arg in $entries; do
argpath=$(echo "$ARGPATHS" | grep "/$arg$")
[ -f "$argpath/remove" ] && mv "$argpath/remove" "$argpath/remove.old" \
&& echo "✔ $argpath has been hidden" || echo "✖ Can't hide \"$arg\", app already hidden or non-existent"
done
else
for arg in $entries; do
[ "$AMCLI" = am ] && [ -f "/opt/$arg/remove.old" ] && mv "/opt/$arg/remove.old" "/opt/$arg/remove" \
&& echo "✔ /opt/$arg can be managed again"
[ -n "$APPMAN_APPSPATH" ] && [ -f "$APPMAN_APPSPATH/$arg/remove.old" ] && mv "$APPMAN_APPSPATH/$arg/remove.old" "$APPMAN_APPSPATH/$arg/remove" \
&& echo "✔ $APPMAN_APPSPATH/$arg can be managed again"
done
_clean_amcachedir
fi
}

################################################################################
# SYNC
################################################################################
Expand Down Expand Up @@ -1208,6 +1231,10 @@ case "$1" in
'clean'|'-c')
_use_clean
;;
'hide'|'unhide')
_determine_args
_use_hide_unhide "$@"
;;
'newrepo'|'neodb')
_use_newrepo "$@"
;;
Expand Down Expand Up @@ -1310,6 +1337,12 @@ case "$1" in

Description: Prints this message.

${Gold}hide\033[0m

${LightBlue}$AMCLI hide {PROGRAM}\033[0m

Description: Prevents an installed application from being shown or managed by \"$AMCLI\".

${Gold}home, -H, --home\033[0m

${LightBlue}$AMCLI -H {PROGRAM}\033[0m
Expand Down Expand Up @@ -1421,6 +1454,12 @@ case "$1" in

Description: Generate a custom installation script. To test the scripts, use the \"${LightBlue}$AMCLI -i '/path/to/script'\033[0m\" command or enter the directory of the script and run the \"${LightBlue}$AMCLI -i ./script\033[0m\" command, even using dedicated flags, if necessary (see \"-i\").

${Gold}unhide\033[0m

${LightBlue}$AMCLI unhide {PROGRAM}\033[0m

Description: Allow a hidden app to be shown and managed again (nulls \"hide\").

${Gold}unlock\033[0m

${LightBlue}$AMCLI unlock {PROGRAM}\033[0m
Expand Down
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,15 @@ Shows the list of all installed programs, with sizes. By default apps are sorted

Prints this message.

------------------------------------------------------------------------
### hide

am hide {PROGRAM}

**Description**:

Prevents an installed application from being shown or managed by "am"/"appman".

------------------------------------------------------------------------
### `home`, `-H`, `--home`

Expand Down Expand Up @@ -554,6 +563,15 @@ Updates this script to the latest version hosted.

Generate a custom installation script. To test the scripts, use the "`am -i '/path/to/script'`" command or enter the directory of the script and run the "`am -i ./script`" command, even using dedicated flags, if necessary (see "`-i`").

------------------------------------------------------------------------
### unhide

am unhide {PROGRAM}

**Description**:

Allow a hidden app to be shown and managed again (nulls "`hide`").

------------------------------------------------------------------------
### `unlock`

Expand Down