AppImageUpdate icon indicating copy to clipboard operation
AppImageUpdate copied to clipboard

"Run app" for CLI apps

Open probonopd opened this issue 8 years ago • 9 comments

When you update a CLI app (desktop file has Terminal=true), then "Run app" should open the app in a terminal.

wget https://download.opensuse.org/repositories/home:/nandub:/MyAppImages/AppImage/aria2-latest-x86_64.AppImage
# Run AppImageUpdate GUI on the just downloaded AppImage
# "Run app" --> Nothing happens in the GUI

Note that this particular AppImage has True instead of true:

me@host:~$ /home/me/Downloads/aria2-1.24.0-1.1.Build12.15.glibc2.17-x86_64.AppImage --appimage-extract '*.desktop'
squashfs-root/aria2.desktop
me@host:~$ cat squashfs-root/aria2.desktop 
[Desktop Entry]
Type=Application
Name=Aria2
Exec=aria2c
Icon=aria2
Categories=Network;Download Manager
Comment=aria2 is a lightweight multi-protocol & multi-source, cross platform download utility operated in command-line. It supports HTTP/HTTPS, FTP, SFTP, BitTorrent and Metalink
Terminal=True

me@host:~$ desktop-file-validate squashfs-root/aria2.desktop 
squashfs-root/aria2.desktop: error: value "Network;Download Manager" for string list key "Categories" in group "Desktop Entry" does not have a semicolon (';') as trailing character
squashfs-root/aria2.desktop: error: value "True" for boolean key "Terminal" in group "Desktop Entry" contains invalid characters, boolean values must be "false" or "true"

probonopd avatar Nov 03 '17 14:11 probonopd

@probonopd how can we efficiently extract that bit of information to make it available to AppImageUpdate? I guess one has to mount the AppImage and extract the .desktop file. Is there an easier way?

TheAssassin avatar Nov 03 '17 15:11 TheAssassin

It should be possible to extract the relevant code from appimaged I guess.

probonopd avatar Nov 03 '17 16:11 probonopd

We really need to refactor that code as well, and provide a "libappimage", I guess.

TheAssassin avatar Nov 03 '17 17:11 TheAssassin

Quite possibly.

probonopd avatar Nov 03 '17 17:11 probonopd

I guess I'll extract the code to shared.c for now, then I just need to consume that file.

TheAssassin avatar Nov 03 '17 17:11 TheAssassin

Rethinking this, I don't think the approach of opening an AppImage in a terminal is a good idea per se. The problem is that tools which expect arguments etc. will cause the terminal to collapse immediately, without showing any useful error message or something alike to the user.

How about just opening a terminal in the right directory? Maybe (but that's a big maybe) you could already "pre-type" the command, so a user just has to hit "enter". But we need a shell around the application which will stay open in the background.

Also, the button will have to be renamed to "Launch terminal" etc.

TheAssassin avatar Nov 15 '17 02:11 TheAssassin

Opening a terminal that already has $PATH set, and printing a clear message in the opened terminal would probably be the best way to go, but for the short run it would be sufficient for me if the button appeared only for GUI apps, that is, in all cases in which we do not positively find Terminal=true in the desktop file (which can be either Terminal=false or no Terminal= or no desktop file at all, and possibly other situations).

probonopd avatar Nov 15 '17 07:11 probonopd

The problem with all these approaches begins with the fact that there is no cross-platform way of opening a terminal. I guess that's again something to add to libDE.

TheAssassin avatar Nov 15 '17 12:11 TheAssassin

Another argument then for

it would be sufficient for me if the button appeared only for GUI apps

probonopd avatar Nov 15 '17 18:11 probonopd