Skip to content

Set Qt GUI as default app to open .rpz packages on first open #216

Closed
@remram44

Description

@remram44

It is easy to select ReproUnzip.app on Mac, or navigate to reprounzip-qt on Windows. On Linux it is more involved:

#!/bin/bash

# Install x-reprozip mimetype
cat >/tmp/reprozip-mime.xml <<'END'
<?xml version="1.0"?>
<mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'>
  <mime-type type="application/x-reprozip">
    <comment>ReproZip Package</comment>
    <glob pattern="*.rpz"/>
  </mime-type>
</mime-info>
END
xdg-mime install /tmp/reprozip-mime.xml
update-mime-database $HOME/.local/share/mime

# TODO: install icon

# Install desktop file
mkdir -p $HOME/.local/share/applications
cat >$HOME/.local/share/applications/reprounzip.desktop <<END
[Desktop Entry]
Name=ReproUnzip
Exec=$(which reprounzip-qt) %f
Type=Application
MimeType=application/x-reprozip
END
update-desktop-database $HOME/.local/share/applications

When running on Linux, the GUI app should check if it is registered, if not ask the user confirmation and register itself via something like the code above.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-unpack-guiComponent: The Qt unpacking GUI (reprounzip-qt)T-enhancementType: En enhancement to existing code, or a new featuregood first issueNewcomers welcome! This should be easy and self-contained enough for someone new to the codebase

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions