Skip to content

Commit 1c0d7fc

Browse files
authoredDec 1, 2024
Merge pull request #1174 from Samueru-sama/dev
simplify how to get path to appimage
2 parents f5a1ced + 9157b55 commit 1c0d7fc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

‎APP-MANAGER

+2-2
Original file line numberDiff line numberDiff line change
@@ -628,7 +628,7 @@ function _clean_launchers() {
628628
rm -f "$AMCACHEDIR"/mountpoints
629629
for var in "$DATADIR"/applications/AppImages/*.desktop; do
630630
# full path to appimage
631-
appimagename=$(grep "^Exec=" 0<"$var" 2>/dev/null | head -1 | cut -c 6- | sed 's/"//g; s/\s.*$//')
631+
appimagename=$(awk -F'=| ' '/Exec=/{print $2; exit}' "$var" | sed 's/"//g; s/\s.*$//')
632632
# name of the appimage
633633
launcher2del=$(basename -- "$(echo "$appimagename" | tr '[:upper:]' '[:lower:]')")
634634
# removable mount point where the appimage may be stored
@@ -932,7 +932,7 @@ function _update_launchers() {
932932
else
933933
echo " ◆ Update local AppImages integrated manually"
934934
for var in "$DATADIR"/applications/AppImages/*.desktop; do
935-
appimage_full_path=$(grep "^Exec=" 0<"$var" 2>/dev/null | head -1 | cut -c 6- | sed 's/"//g; s/\s.*$//')
935+
appimage_full_path=$(awk -F'=| ' '/Exec=/{print $2; exit}' "$var" | sed 's/"//g; s/\s.*$//')
936936
appimagename=$(basename -- "$appimage_full_path")
937937
appimage_path=$(echo "$appimage_full_path" | sed -E 's|/[^/]+$|/|; s/\/*$//g')
938938
printf "%b\n File: %b%b\033[0m\n Path: %b" "$DIVIDING_LINE" "${Green}" "$appimagename" "$appimage_path"

0 commit comments

Comments
 (0)
Please sign in to comment.