Um in Linux als Programm/App sichtbar/registriert zu sein, brauchen einen „Desktop Entry“ unter den Programmen/Apps unter
~/.local/share/applications/
Beispiel für eine Desktop Entry Datei
[Desktop Entry] Name=Inkscape Exec=/opt/inkscape/Inkscape.AppImage %u Icon=/opt/inkscape/inkscape-logo.svg Comment=Draw Freely Type=Application Terminal=false Encoding=UTF-8 Categories=Utility; StartupNotify=true StartupWMClass=org.inkscape.Inkscape
Skripte für Desktop Entries
Skript um Bilder aus Appimage zu generieren
#!/bin/bash
set -e
set -o pipefail
APPIMAGE_PATH=$1
if [ -z "$APPIMAGE_PATH" ]; then
echo "Missing argument: appimage"
exit 1
fi
if [ ! -f "$APPIMAGE_PATH" ]; then
echo "File not found: $APPIMAGE_PATH"
exit 1
fi
TEMP_SQUASHFS_PATH=$(mktemp -d)
APPIMAGE_FULLPATH=$(readlink -e "$APPIMAGE_PATH")
APPIMAGE_FILENAME=$(basename "$APPIMAGE_PATH")
APP_NAME="${APPIMAGE_FILENAME%.*}"
DESKTOP_ENTRY_PATH="${HOME}/.local/share/applications/$APP_NAME.desktop"
ICON_FOLDER="${HOME}/.local/share/icons"
mkdir -p "${ICON_FOLDER}"
if [ "$2" == "--remove" ]; then
rm -f "$DESKTOP_ENTRY_PATH"
find "${ICON_FOLDER}" -maxdepth 1 -type f -name "$APP_NAME.*" -delete
echo "Removed"
exit 0
fi
pushd $TEMP_SQUASHFS_PATH
"$APPIMAGE_FULLPATH" --appimage-extract > /dev/null
cd squashfs-root/
echo "Choose icon: "
mapfile -t FILENAMES < <(find -L . -maxdepth 1 -type f \( -iname '*.png' -o -iname '*.svg' \))
i=1
for filename in "${FILENAMES[@]}"
do
printf " %d) %s\n" "$i" "$filename"
i=$((i + 1))
done
read -r SELECTED_INDEX
ICON_SRC=${FILENAMES[$((SELECTED_INDEX - 1))]}
ICON_EXT="${ICON_SRC##*.}"
ICON_DST="${ICON_FOLDER}/$APP_NAME.$ICON_EXT"
cp "$ICON_SRC" "$ICON_DST"
cat <<EOT > "$DESKTOP_ENTRY_PATH"
[Desktop Entry]
Name=$APP_NAME
StartupWMClass=$APP_NAME
Exec="$APPIMAGE_FULLPATH"
Icon=$ICON_DST
Type=Application
Terminal=false
EOT
popd
rm -rf $TEMP_SQUASHFS_PATH
echo "Created"
Skript Kemi
#!/bin/bash # Überprüfen, ob die Datei als Argument übergeben wurde if [ „$#“ -ne 2 ]; then echo „Benutzung: $0 “ exit 1 fi SCRIPT_PATH=$1 STARTER_NAME=$2 # Basisverzeichnis für KDE-Starter STARTER_DIR=“$HOME/.local/share/applications“ # Starter-Datei erstellen STARTER_FILE=“$STARTER_DIR/$STARTER_NAME.desktop“ # Inhalt für die Starter-Datei echo „[Desktop Entry]“ > „$STARTER_FILE“ echo „Type=Application“ >> „$STARTER_FILE“ echo „Name=$STARTER_NAME“ >> „$STARTER_FILE“ echo „Exec=$SCRIPT_PATH“ >> „$STARTER_FILE“ echo „Icon=utilities-terminal“ >> „$STARTER_FILE“ # Hier kann das Icon angepasst werden echo „Terminal=false“ >> „$STARTER_FILE“ echo „Categories=Utility;“ >> „$STARTER_FILE“ echo „Comment=Starte $STARTER_NAME“ >> „$STARTER_FILE“ # Berechtigungen für die Datei setzen chmod +x „$STARTER_FILE“ echo „Starter für $STARTER_NAME wurde erstellt: $STARTER_FILE“
The table below lists all Main Categories.1
| Main Category | Description | Notes |
|---|---|---|
| AudioVideo | Application for presenting, creating, or processing multimedia (audio/video) | |
| Audio | An audio application | Desktop entry must include AudioVideo as well |
| Video | A video application | Desktop entry must include AudioVideo as well |
| Development | An application for development | |
| Education | Educational software | |
| Game | A game | |
| Graphics | Application for viewing, creating, or processing graphics | |
| Network | Network application such as a web browser | |
| Office | An office type application | |
| Science | Scientific software | |
| Settings | Settings applications | Entries may appear in a separate menu or as part of a „Control Center“ |
| System | System application, „System Tools“ such as say a log viewer or network monitor | |
| Utility | Small utility application, „Accessories“ |
https://askubuntu.com/questions/1328196/how-can-i-create-a-desktop-entry-for-an-appimage
- Registered Categories for Linux/Unix Systems defined by freedesktop.org
https://specifications.freedesktop.org/menu/latest/category-registry.html ↩︎

Schreibe einen Kommentar
Du musst angemeldet sein, um einen Kommentar abzugeben.