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

[Feature Request] Linux Desktop Entry #582

Open
lvjonok opened this issue Jul 22, 2024 · 7 comments
Open

[Feature Request] Linux Desktop Entry #582

lvjonok opened this issue Jul 22, 2024 · 7 comments
Labels
feature-request New feature request

Comments

@lvjonok
Copy link

lvjonok commented Jul 22, 2024

I wanted to highlight that running an application from the terminal as ./Paperlib.AppImage might not be as convenient for users. To streamline the process, I have created a simple shell script to add a desktop entry. This script can be particularly useful for making the application easily accessible from the desktop environment.

Script Details:

#!/bin/bash

# Check if the AppImage path is provided as an argument
if [ -z "$1" ]; then
    echo "Usage: $0 /path/to/your/AppImage"
    exit 1
fi

# Define the path to the AppImage
APPIMAGE_PATH="$1"

# Get the base name of the AppImage to use for the desktop entry name and icon
APPIMAGE_NAME=$(basename "$APPIMAGE_PATH" .AppImage)

# Define the desktop entry path
DESKTOP_ENTRY_PATH="$HOME/.local/share/applications/$APPIMAGE_NAME.desktop"

# Create the desktop entry file
cat << EOF > $DESKTOP_ENTRY_PATH
[Desktop Entry]
Version=1.0
Type=Application
Name=$APPIMAGE_NAME
Exec=$APPIMAGE_PATH
Icon=$APPIMAGE_PATH
Comment=$APPIMAGE_NAME AppImage
Categories=Utility;
Terminal=false
EOF

# Make the desktop entry executable
chmod +x $DESKTOP_ENTRY_PATH

echo "Desktop entry created at $DESKTOP_ENTRY_PATH"

Usage:

You can use this script as follows:

./create_paperlib_entry.sh /path/to/your/Paperlib.AppImage

This should fit well into the installation procedure for Linux.

@lvjonok lvjonok added the feature-request New feature request label Jul 22, 2024
@GeoffreyChen777
Copy link
Member

Hi thanks for your script.

it would be nice to put it on our website. Are you happy with it? (I will mention you as the author of the script on our webpage.)

@lvjonok
Copy link
Author

lvjonok commented Jul 22, 2024

It worked well, the improvements might be to add Icon to the app.

@GeoffreyChen777
Copy link
Member

I’m not familiar with the Desktop Entry, what is the image format of the icon? How to use it in the script?

@lvjonok
Copy link
Author

lvjonok commented Jul 22, 2024

I did a quick search: supermerill/SuperSlicer#2594 (comment)

Looks like paperlib.png should be placed in usr/share/icons of AppImage build to work out of the box with my shell script.

@GeoffreyChen777
Copy link
Member

So add this should be ok?

curl -o /usr/share/icons/paperlib.png https://raw.githubusercontent.com/Future-Scholars/paperlib/main/assets/icon.png

@lvjonok
Copy link
Author

lvjonok commented Jul 22, 2024

I believe it should be solved on the level of AppImage build process. You can unzip the AppImage with ./Paperlib.AppImage --appimage-extract. And inside this fs at squashfs-root/usr/share/icons the desired icon should be located.

@GeoffreyChen777
Copy link
Member

OK, I will try this with the next release. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request New feature request
Projects
None yet
Development

No branches or pull requests

2 participants