-
Notifications
You must be signed in to change notification settings - Fork 2.2k
[Linux] Add nativefier apps to menu / create FreeDesktop .desktop
files
#204
Comments
EditThe .desktop file should be in:
|
@flofreitag I agree that it should be easier for a user to be able to open the a Nativefier app after it is created. Though I'm wondering if creating a .desktop file is a job that should be relegated to Nativefier? My thinking was to contribute .desktop files for various apps that user may end up using. I'm not sure what's the best approach to solve this problem. Having .desktop is part of the solution but not the full solution I think. |
To start with it needs to be documented that users on Debian, at least, will need to do this for the nativefied application to work as we expect a native application to work— launchable by application launchers, findable in the OS menu. Very grateful to ghost for having this issue, which served as the critical documentation for me! I'd say it's a core enough feature that it should be built into nativefier, if not by default on Linux than with a flag. |
Note also that once an application has a .desktop file in ~/.local/share/applications, the Nativifier-created application will work from launchers also. |
@mlncn I have found that if i manually create a desktop app and save it to the doc when I open the app it creates a second instance of it alongside the other. Have you seen this? Something like WhatsApp and WhatsApp{sha} |
@darrenhaken same here, Fedora 25 with Gnome, as you can see on screenshot, the first Trello icon is a pinned one after making a |
Actually a name can be easily fixed by editing a |
@mvoropaiev @darrenhaken You're missing a setting in your desktop file. This has to do with the To find out the corresponding Here's an example desktop file:
|
@tdgroot that helped with the issue actually! Now when I launch the application it reuses the same window. It does however launch a second version of the app rather than simply using the one which is already open. Make sense? |
Hi, I started Nativefier Freedesktop here on GitHub to provide the best integration on Linux desktop. Feel free to look at it for inspiration or helping to finish it. |
@quanglam2807 I think you are exaggerating: you suggested your tool as an alternative to Nativefier to a lot of issues. I tried your app, it's cool but it has different purposes than Nativefier. |
@quanglam2807 Nativefier does everything I need thanks. Installation should be by design out of scope for Nativefier. That's why I started Nativefier Freedesktop that is a tool to automate the installation of Nativefier apps on Linux desktops. |
@alxlg All in one? You are exaggerating. Nativefier creates a Electron container for each app. WebCatalog creates a shortcut. Which one is more exaggerating? You don't need it, but others may. The point is not to create software for advanced users like you who understand "Unix philosophy" but to create software people can use easily. By the way, I'm tagging @ghost, not you. |
@quanglam2807 but I have to see your spam in a lot of Nativefier issues. Doesn't WebCatalog has its own UI? My Nativefier Freedesktop will be very easy to use and totally follow Freedesktop spec for Linux desktop, there is no need to compile anything since it's a bash script. |
@alxlg I'm not spamming randomly. People are looking for solution and as this repo is no longer maintained, I don't see any problem suggesting an alternative. And of course, it takes you so many sentences to explain what it does so it's complicated and for noobs. :) |
@quanglam2807 once installed the user can click on *.webapp files and install them as Freedesktop apps. And *.webapp files can include custom CSS and JS. Is it enough short as explanation? |
@alxlg So they still need to click the webapp file, they still need to find the URL, they still need to find an icon, they still need to update the app manually later. And injecting CSS and JS is coming to WebCatalog. Does Freedesktop works on macOS and Windows? I feel like you are pitching about your project and then being upset because I disrupt you with mine. |
@quanglam2807 no, they just need to click on a .webapp file that contains everything. They will be able to uninstall webapp from their menu and they will be able to update them from there. So are you going to add Linux desktops support without knowing what Freedesktops are? Good luck. MacOS and Windows? Are you kidding me? I said from the first moment I did a script for Nativefier+Linux and I said "do one thing and do it well". On the other side there is you with your all-in-one solution that don't know what Freedesktop is. And notice that I just said in the first comment: take a look at my script for inspiration, I don't say "try my all-in-one solution" without an exaplanation as you are used to do in Nativefier issues. |
Can you take this to a private chat or something? It's off topic and I don't feel it's respectful. It's good to have diverse products (also a Unix philosophy) |
@darrenhaken Kudo! |
@quanglam2807 I already said that your WebCatalog has nothing to do with this issue. I specifically wrote a solution for this issue and I commented only here suggesting to take inspiration from it. You commented on a big amount of Nativefier issues just saying "try WebCatalog". Though yours is a very cool app, stop suggesting a totally different app to people that are commenting an issue of Nativefier. If your WebCatalog solves that issue is OK, but your WebCatalog doesn't use Freedesktop specifications so it has nothing to do with this issue. |
@darrenhaken did you notice that @quanglam2807 commented on an enormous amount of Nativefier issues saying to try WebCatalog that is a totally different thing and often has nothing to do with the issues he comment? Isn't it spam? |
|
@quanglam2807 it doesn't use Nativefier. It's like spamming Firefox bug tracking system with suggestions to use Chrome. Yes both Chrome and Firefox are used to browse the Web, but issue tracking systems shouldn't be used to promote totally different software. If I can build an app from a URL I choose with Nativefier and then your tool add that to app menu I will recognize that your tool is a solution to this issue. |
@alxlg In your point of view. But as @darrenhaken suggested, I think we should stop. |
@quanglam2807 if this is the last time I see you promoting WebCatalog in Nativefier issues tracker. |
@alxlg I don't promote. But I'll mention WebCatalog if it is relevant to any issue. |
A little bit late, but I just submitted a Pull Request solving this issue: #729 |
@alxlg @darrenhaken @eduardo-robles @ghost @leonidas @mlncn @mvoropaiev @quanglam2807 @tdgroot : I'm looking at @leonidasv 's PR adding automatic creation of
Is everyone okay with such an {automatic, not disableable} creation, or does anyone have a good reason to require a flag? If you're all good, vote this comment with a 👍. If you oppose, vote 👎 and add a comment explaining why. |
@ronjouch @leonidasv looks good! To me this seems like default behaviour, so you have my 👍. |
+1 |
.desktop
files
So, #799 (a duplicate of this issue) reminded me this issue is still open, and I didn't merge PR #729 (sorry @leonidasv), for a reason I never took the time to explain, so here it is. The problem is that once a user creates a Nativefier app, they will often move it to wherever they please (for example, to People want automatic creation of So, and re-considering the potentially menu-polluting-with-broken-links consequences of #729, here's pseudocode for what I think could make sense:
If that makes sense, PR / rework of PR #729 welcome. Yesterday I put a little helper text telling about the
|
@ronjouch I think the approach works, or alternatively this text could just be output in the Terminal instead of a separate README file. But either works, and each has its pros/cons. I also understand that it might feel outside the realm of Nativefier to install the app locally, though I think that is what people on Linux would want when using Nativefier. But again, a separate tool could also be in charge of moving the files into the right places to "install" them, if so desired. Either way, at least generating a usable .desktop file out of the box would seem to be a big improvement to me. 👍 |
@cassidyjames my intention behind suggesting writing an extra README file is that I anticipate users looking at the .desktop file and thinking "oh where should I put this, again? How do I edit it?". The extra file adds a tiny bit of clutter to the output dir, but will be here when these users will need it without the need to search the web or start a new Nativefier build just to get the help again.
I agree what most people want is a launcher entry straight in their menu, and it's exactly what PR #729 does. But given the high potential for breakage due to moving an app after build, I think it was a bad idea. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
@ronjouch I know it but again: the right way to install third party apps on Linux/Freedesktop is using Flatpak, not adding a .desktop launcher that execute a binary in a fixed user folder. Otherwise you could add a parameter that:
|
I've been creating my own .desktop files over and over again by copying from an older Nativefier to the newer one and replacing all the paths, categories, keywords, icons and names etc. I often forget the path for the .desktop files so I even wrote an alias to help me move the file into place after I finish editing it:
(~/.zshrc, ~/.bashrc, ~/.profile etc.) I could take this further on my own but, it sure would be nice if Nativefier was able to chip in here a bit from the get go. What I'd like to see is the creation of the .desktop file at build time and have it placed in the build folder with current paths completed (like in the PR) and then we can move the file and adjust paths accordingly, on our own accord. Anyone who knows what a .desktop file is will know they have to edit paths. Anyone who doesn't know what a .desktop file is or is looking for what amounts to a .desktop file is going to start googling or asking around and subsequently find out what they are and learn how to manage them; including where they need to live in order to show up in menus etc. If done this way and it's not used it can move along with the app folder, no harm no foul. Then for those of us who'd like to use it, we will know what to do with it (or start googling and learn, like all those who've used Linux before us have had to do.) |
Maybe if the PR is wrapped in a flag with a help comment that states, something along the lines of, "note: if you move the .desktop file to your user application folder or similar location, usually ~/.local/share/applications/, this to have it show up in the menus, you'll need to edit the paths directly in the .desktop file itself." Or something like that. Would that be sufficient? Anyone who is using the flag or learning about it for the first time will now know they have to edit the paths and potentially understand where .desktop files should live too. |
@Natetronn yup and that's exactly what #204 (comment) suggests. PR welcome 🙂. |
My comment was marked as off topic but it's relevant. If you are talking about .desktop files you are talking about INSTALLATION and that includes:
and also moving the icon in the icons folder. Please don't break Freedesktop spec by pointing the .desktop file to some random path for the executable and the icon. |
This comment has been minimized.
This comment has been minimized.
I created a zenity interface for nativefier that automatically creates and installs |
I too made a script: NAME=Fastmail
URL=https://fastmail.com
ICON_PNG_URL=https://www.fastmail.com/static/favicons/touch-icon-196x196.png
DESCRIPTION=Social
cat << EOF > /tmp/inject.css
EOF
cat << EOF > /tmp/inject.css
EOF
mkdir apps &> /dev/null
cd apps
rm -rf "$NAME" "/usr/local/lib/$NAME" &> /dev/null
echo "$CSS" > "/tmp/inject.css"
echo "$JS" > "/tmp/inject.js"
nativefier "$URL" --single-instance --name "$NAME" --inject /tmp/inject.css --inject /tmp/inject.js
mv "$NAME-linux-x64" "$NAME"
if [ -n "$ICON_PNG_URL" ]; then
ehco OVERRIDE
curl -o "$NAME/resources/app/icon.png" "$ICON_PNG_URL"
fi
cp ../bootstrap.sh "$NAME/"
echo "[Desktop Entry]
Type=Application
Version=1.0
Name=$NAME
StartupWMClass=`jq -r '.name' "$NAME/resources/app/package.json"`
Comment=$DESCRIPTION
Exec=/usr/local/lib/$NAME/$NAME
Icon=/usr/local/lib/$NAME/resources/app/icon.png
Terminal=false
Categories=GTK
MimeType=text/html;text/xml;application/xhtml_xml;
" > "$NAME"/"$NAME".desktop
chmod +x "$NAME"/"$NAME".desktop
sudo cp -rf "$NAME" "/usr/local/lib/"
sudo mkdir /usr/local/share/applications &> /dev/null
sudo cp "$NAME/$NAME.desktop" /usr/local/share/applications/
|
Programs which are created with nativefier won't appear in the application menu.
I am a Linux-user (Linux Mint) and when i create a new app with nativefier I always have to create a .desktop file by myself to add the app to my application menu. It is not a big deal to make it by myself but it is boring after some time. So it would be nice to have a feature build in nativefier which makes this for the user.
Improvements
Code
Here is a little help if you need it: https://community.linuxmint.com/tutorial/view/1504
The .desktop file should be in the same directory like the created application.
Here is a little example for a .desktop file for whatsapp:
Thanks
However, thank you for this usefull tool. I am also sorry for my bad english.
The text was updated successfully, but these errors were encountered: