plash-pkg: Application installer and launcher
Status: implemented
The package installer should put installed applications into the GNOME/KDE applications menu and register the application as able to handle file types. This involves creating a .desktop file.
Provide a script that ties together the choose/fetch/unpack steps of Story1 in order to acquire the application package and its dependencies. It should also output a .desktop file. The .desktop file's Exec field will run a helper script that sets up a sandbox, including an FsObjCopyOnWrite directory as the root directory, and launches the application, possibly granting it access to any files it was launched to edit.
This story covers:
- plash-pkg-launch: launch an installed application in a sandbox
- plash-pkg-deb-inst: run Debian preinst/postinst scripts
- plash-pkg-install:
Joins up the components in Story1
- Writes out a .desktop file for launching the app through plash-pkg-launch
- Controlled via a config file
Config file
The install script will take as input a config file with the following fields:
- Depends: list of packages to install, in the format of a Debian "Depends" field. Passed to "choose".
- Exec: command to execute inside the sandbox in order to launch the application.
- Pet-name: name of application, to use in Name field of desktop entry.
- Pet-id: short name of application, to put into filename of desktop entry. Not displayed to user.
- Icon (optional): filename of icon, used in Icon field of desktop entry.
MimeType (optional): list of file types handled by the application, put into Icon field of desktop entry.
Example:
Depends: leafpad Pet-name: Leafpad text editor (sandboxed) Pet-id: leafpad Icon: leafpad.png Exec: LD_PRELOAD=powerbox-for-gtk.so leafpad "$@" MimeType: text/plain;
Usage
plash-pkg-install <app-dir> [-c <config-file>]
State associated with the application is stored in <app-dir>. When the -c option is given, the tool will create <app-dir>, copy in the given config file, acquire and unpack the Debian packages (the choose/fetch/unpack steps), and install the application by creating a .desktop file.
When no -c option is given, <app-dir> must already exist, and the config file it contains is used.
Example output .desktop file
[Desktop Entry] Version=1.0 Type=Application Name=Leafpad text editor (sandboxed) Icon=leafpad.png Exec=plash-pkg-launch --app-dir /home/user/.pet-apps/apps/leafpad --open-file %f MimeType=text/plain; Categories=SandboxedApps;
See also
Relevant specifications:
Use desktop-file-validate to check the .desktop file.
How to create a menu for sandboxed applications
Copy /etc/xdg/menus/applications/gnome-applications.menu or /etc/xdg/menus/applications/applications.menu to ~/.config/menus/ and edit, OR add a .menu file to ~/.config/menus/applications-merged.
Tasks
Rewrite Perl code in Python (also in Story1)
Grant access to /etc/localtime by default
Change plash-pkg-launch to clean out the environment first
- This will stop X apps taking a long time to start up because SESSION_MANAGER is defined but the socket in inaccessible
Make plash-pkg-deb-inst quieter: reduce output
Run plash-pkg-deb-inst from plash-pkg-install
- Provide a simple way to create a "Sandboxed apps" submenu in the GNOME/KDE menu
