Skip to content

Commit

Permalink
Add new option "icon-theme"
Browse files Browse the repository at this point in the history
...to allow launchers using custoom icon themes, see #922
  • Loading branch information
ivan-hc authored Sep 4, 2024
1 parent 2faa0c6 commit 50c52e6
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
5 changes: 3 additions & 2 deletions APP-MANAGER
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

AMVERSION="8.1.1-2"
AMVERSION="8.2-beta1"

# Determine main repository and branch
AMREPO="https://raw.githubusercontent.com/ivan-hc/AM/main"
Expand Down Expand Up @@ -287,7 +287,7 @@ _am_newrepo_check "$@"

# COMPLETION LIST
available_options="about add apikey backup clean config disable downgrade download enable extra files \
home info install install-appimage launcher list lock neodb newrepo nolibfuse off on overwrite \
home icon-theme info install install-appimage launcher list lock neodb newrepo nolibfuse off on overwrite \
purge query remove sandbox select sync template test unlock update --appimages --apps --byname \
--config --convert --debug --devmode-disable --devmode-enable --force-latest --home --launcher \
--less --pkg --rollback --disable-sandbox --sandbox --system --user"
Expand Down Expand Up @@ -1095,6 +1095,7 @@ case "$1" in
;;
'backup'|'-b'|\
'downgrade'|'--rollback'|\
'icon-theme'|\
'launcher'|'--launcher'|\
'lock'|'unlock'|\
'nolibfuse'|\
Expand Down
21 changes: 21 additions & 0 deletions modules/management.am
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,15 @@ function _downgrade() {
echo "ROLLBACK SUCCESSFUL!"
}

# ICON THEME CHANGER
function _icon_theme() {
if [ "$AMCLI" = am ]; then
$SUDOCMD sed -i "s#Icon=$APPSPATH/$arg/icons/#Icon=#g" /usr/local/share/applications/"$arg"*AM.desktop 2>/dev/null
else
sed -i "s#Icon=$APPSPATH/$arg/icons/#Icon=#g" "$DATADIR"/applications/"$arg"*AM.desktop 2>/dev/null
fi
}

# LAUNCHER
function _launcher_appimage_extract() {
"$arg" --appimage-extract share/icons/*/*/* 1>/dev/null
Expand Down Expand Up @@ -332,6 +341,18 @@ case "$1" in
done
;;

'icon-theme')
# Place local AppImages into the menu by dragging and dropping them into the terminal
if [ "$2" = "--all" ]; then
ARGS=$(find . -name 'remove' -printf "%h\n" 2>/dev/null | du -sh -- * 2>/dev/null | sort -rh | sed 's@.* @@')
else
ARGS="$(echo "$@" | cut -f2- -d ' ')"
fi
for arg in $ARGS; do
_icon_theme "${@}"
done
;;

'launcher'|'--launcher')
# Place local AppImages into the menu by dragging and dropping them into the terminal
ARGS="$(echo "$@" | cut -f2- -d ' ')"
Expand Down

0 comments on commit 50c52e6

Please sign in to comment.