GithubHelp home page GithubHelp logo

hellosystem / launch Goto Github PK

View Code? Open in Web Editor NEW
16.0 3.0 6.0 243 KB

Command line tool to launch applications, will search for .app bundles and .AppDir directories in various directories, and will show launch errors in the GUI

License: BSD 2-Clause "Simplified" License

CMake 4.29% C++ 95.61% Python 0.11%
hellosystem gui desktop usability qt

launch's People

Contributors

probonopd avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

launch's Issues

Launch Services like database?

Considering FreeBSD where the package database is actually a SQLite database rather than a bunch of text files, I wonder whether we should have the file manager build up a (per-mountpoint?) Launch Services like database that could be used to, amongst other things,

  • Know where apps are that can open certain MIME types
  • Know where the most recent version of an app is

Let's do to XDG application handling what FreeBSD did to the Debian package management plain text files... out-engineer them ;-)

Further reading:
AppImageCommunity/appimaged#30

Read desktop files inside AppImages

Remaining part from #26 (comment):

% chmod +x ~/Downloads/Telegram_Desktop-x86_64.AppImage 
% ~/Downloads/Telegram_Desktop-x86_64.AppImage --appimage-extract
% cat squashfs-root/telegram.desktop
(...)
MimeType=x-scheme-handler/tg;
(...)

So, when encountering an AppImage, then "the system" (I still need to decide which component) needs to place the link to ~/.local/share/launch/MIME/.../ based on the information in MimeType= in the .desktop file inside the AppImage. (This already happens for .desktop files which are not inside AppImages.)

Possibly we can use the new libsqsh library by @Gottox for this. It looks promising and is under a permissive license.

Need to log comment on the error window

20231005_104535

A notification with Log will appear in some error windows, but the window becomes too large and sometimes exceeds the screen. I hope there can be a similar solution as shown in the figure.

images - 2023-10-07T014824 494
Ubuntu_Update_error

Alpine Linux: Segfaults when trying to launch firefox.desktop

This works:

[Desktop Entry]
Version=1.0
Name=Firefox
Exec=firefox
Icon=firefox
Terminal=false
X-MultipleArgs=false
Type=Application
MimeType=text/html;text/xml;application/xhtml+xml;x-scheme-handler/http;x-scheme-handler/https;application/x-xpinstall;application/pdf;application/json;
StartupNotify=true
StartupWMClass=firefox
Categories=Network;WebBrowser;
Actions=new-window;new-private-window;

This segfaults:

Exec=/usr/lib/firefox/firefox %u

Programs launched with 'launch' crash if they try to use stderr after X seconds

  • When an application is launched through the launch command, then it will exit as soon as it wants to print something to stdout and/or stderr after the p.waitForFinished period has elapsed
  • No output is printed to stdout at all before the p.waitForFinished period has elapsed fixed using p.setProcessChannelMode(QProcess::ForwardedChannels);
  • If launch Menu is used to launch the global menu bar, then it will exit if the p.waitForFinished period has elapsed and the user then selects any menu item from the System menu (but not from some other menus). Possibly because selecting commands from the System menu makes liberal use of qDebug() to print debug information to the console?
  • If qpdf is launched with the launch command, then it will exit after the p.waitForFinished period (when set to 3 seconds, possibly because around 3 seconds it wants to write QKqueueFileSystemWatcherEngine::addPaths: open: No such file or directory to stderr). Why? (Setting a longer p.waitForFinished period might do away with this immediate crash because then the QKqueueFileSystemWatcherEngine::addPaths: open: No such file or directory is already written to stderr?)

With p.waitForFinished period set to 10 seconds, then the ping command will exit after 10 seconds, and only then show the output of the ping command fixed using p.setProcessChannelMode(QProcess::ForwardedChannels);

Once this is solved, set the time back to e.g., 3 seconds rather than 10.

Missing a license.

Would be good to know for others who may want to incorporate this into their projects.

Add error handler for ld-linux-x86-64.so.2 not found

This happens when the user is trying to run a Linux application, linux64.ko is loaded but no /compat is mounted and we don't have a fully self-contained bundle:

Currently no error dialog is shown at all.

FreeBSD% launch '/home/user/Applications/Linuxulator/Spotify.AppDir' 
# Found "/home/user/Applications/Linuxulator/Spotify.AppDir"
ELF interpreter /lib64/ld-linux-x86-64.so.2 not found, error 2
Process is not running anymore and exit code was not 0
FreeBSD% launch '/home/user/Applications/Linuxulator/Discord.app' 
# Found "/home/user/Applications/Linuxulator/Discord.app"
ELF interpreter /lib64/ld-linux-x86-64.so.2 not found, error 2
Process is not running anymore and exit code was not 0

Maybe we should point the user toward a download link for the Linux userland/runtime.

Add a way to keep relaunching the payload process in case it exits

Add a way to keep relaunching the payload process in case it exits with an exit code other than 0.

Use case:
launch --relaunch-on-exit Filer --desktop could be used in the startup script. If Filer crashes, it would get automatically restarted. (Reference: helloSystem/hello#172 (comment))

Note:
The time between two non-successful launches should double every time it is tried (to prevent from "respawning too fast" situations due to launch-crash-launch-crash loops).

  • Try to relaunch immediately after the payload process has exited with an exit code other than 0
  • In case the relaunch fails, wait for 2 seconds and retry
  • In case the relaunch fails again, wait for 4 seconds and retry
  • In case the relaunch fails again, wait for 8 seconds and retry
  • and so on
  • Once the relaunch succeeds and the payload application does not exit with an exit code other than 0 within a certain amount of time, reset the delay so that in case the application crashes again, the whole process starts again.

Is this a sensible behavior?

Use FreeBSD extattrs to store file association information

Investigate FreeBSD xattrs to store file association information.
Especially how Haiku uses them (hybrid with resources).

Use case:

  • (1) I have 5 versions of LibreOffice. Which one to use to open LibreOffice documents?
  • (2) Then, I have ONE document that needs LibreOffice 3. How do make sure THIS document gets always opened with THIS LibreOffice? This could be addressed by using xattrs...

https://www.freebsd.org/cgi/man.cgi?query=getextattr&sektion=8&apropos=0&manpath=FreeBSD+11.2-RELEASE

Support application names with whitespace

@xaoseric mentioned that there is an issue.

This works for me:

% launch "PyCharm CE"
(...)
Selected candidate: "/Applications/Developer/PyCharm CE.app/PyCharm CE"
% launch "/Applications/Developer/PyCharm CE.app"
# Found "/Applications/Developer/PyCharm CE.app"

@xaoseric can you please give details?

Start showing a bouncing icon in the Dock

Start showing an animated icon in the Dock from the time launch is about to start the application onwards.

The Dock is then responsible for stopping the animated icon and show the regular application icon in case the app has launched, or just remove the animated icon altogether after a timeout, or in case the application exits.

Is there already a protocol/standard for this?

Properly support WINE

Properly support WINE and Windows executables (in case it isn't by default).
We need to think about what this might entail.

[Feature] AppImage Version Detection and Handling Multiples.

As per #10, this is the proposed way for detecting .AppImage versions. Putting this here so we can gather feedback on it. The current implementation currently matches for files with the .AppImage suffix.

So thinking about it again maybe we could do something much simpler which would cover at least >80% of cases:

  1. Look for files with the .AppImage suffix
  2. If there are at least 2 - characters in the filename, remove everything behind the second-last - character from the filename
  3. there is only one - character in the filename, remove everything behind the -
  4. Replace _ with
  5. Compare the result against what the user wants to launch to determine whether we have a candidate
  6. If there are at least 2 - characters in the filename, assume that what is between the first and second - is the version; this will be needed to decide amongst several candidates (to pick the latest version)

Treat .exe like applications

Treat .exe like applications, similar to how we treat application bundles and (as a fallback) .desktop files.

When launching them, construct an environment with the WINEPREFIX they are located in, so that launching an .exe in fact results in it being launched using the correct WINE and the correct WINEPREFIX, even if there are multple ones on the system.

Always open this document...

The check box 'Always open this document with this application' does not do anything.
If checked then the file doesn't open and there is no effect on the file also. Tried with .txt file

Define further error handlers

Define further error handlers, e.g., for

  • Linuxulator has too old a kernel version set
  • A required dependency library is too old
  • A required dependency Python module is not installed
  • A required dependency library is not installed; right now we tell the user to sudo pkg install ... but we should actually offer to do it
  • A required Linux dependency library is not installed
  • (...)

Implemented so far:

image

image

image

Add error handler for GNUstep apps missing their fonts

GNUstep gui programs failing

To Reproduce
Steps to reproduce the behavior:

2 examples

sudo pkg install gnustep systempreferences
openapp SystemPreferences

or

sudo pkg install gmines
open startvalume.
drill down to /usr/local/GNUstep/System//Applications
click on gmines

Expected behavior
I expect a gui to open displaying the gnustep sysm preferences
or
I expect to play gmines
__
Screenshots
2021-07-06-231417_1368x768_scrot

Version (please complete the following information):

Computer (please complete the following information):

  • Device: ASUS ZenBook UX305UA

Additional context
the compiler is working, and my programs that use command line or X11, or SDL2 are working.
But programs using the native AppKit for their gui all fail. Example:

sudo pkg install gnustep systempreferences
openapp SystemPreferences

fails with pages and pages of:
2021-07-06 23:49:37.960 SystemPreferences[14543:101571] The font specified for NSFont, Helvetica, can't be found.

Also, the Helvetica font seems to be installed:
darko@sudanna /usr/local/GNUstep/System/Library/Fonts/Helvetica.nfont $ ls
FontInfo.plist n019004l.pfb n019024l.afm n019043l.pfm n019063l.pfb
n019003l.afm n019004l.pfm n019024l.pfb n019044l.afm n019063l.pfm
n019003l.pfb n019023l.afm n019024l.pfm n019044l.pfb n019064l.afm
n019003l.pfm n019023l.pfb n019043l.afm n019044l.pfm n019064l.pfb
n019004l.afm n019023l.pfm n019043l.pfb n019063l.afm n019064l.pfm

Unable to open .sh file in featherpad

Just created a .sh file in home folder and tried to open using featherpad but it didn't open and tried using open with... but there are no applications to choose in the dialog box.
Using the latest experimental hellosystem (build 0H335)

Handle FBSD_ correctly

image

Instead of

This application requires at least version FBSD_1.7 of libc.so.7 to run.

Please update it and try again.

it should say

This application requires at least version FBSD_1.7 of libc.so.7 to run.

Please update the operating system and try again.

Whenever something requires a different FBSD_, then updating the application is not going to solve it.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.